Skip to content
Back to formatted view

Raw Message

Message-ID: <87bohla938.fsf@pobox.com>
Date: 2012-09-04T19:20:27Z
From: Tom Roche
Subject: [newbie] scripting remote check for R package
In-Reply-To: <CAPvvxJV5GmB3xO5PQzwfeYAbL3jrES+=j=brTmSzPOA8tG8Mpg@mail.gmail.com>

https://stat.ethz.ch/pipermail/r-help/2012-September/322985.html
>>> [how] to script [remote] checking for an R package?

https://stat.ethz.ch/pipermail/r-help/2012-September/323000.html
>> I would call something like this via ssh [...]

>> Rscript -e 'as.numeric(suppressWarnings(suppressPackageStartupMessages(require(ggplot2))))'

https://stat.ethz.ch/pipermail/r-help/2012-September/323024.html
> Thanks! but [the] cluster where I need to run this (where I do *not*
> have root) [lacks Rscript.] So I'm wondering:

> 1 Is there a way to do `Rscript -e` with plain, commandline R?

Incorporating Gergely Dar?czi's last suggestion (k?sz?n?m!) I get

# the package for which to check that has the most dependencies
APEX_PKG='M3' # substitute yours
for RSERVER in 'foo' 'bar' 'baz' ; do
  echo -e "${RSERVER} has:"
  ssh ${RSERVER} "R --version | head -n 1"
  ssh ${RSERVER} "echo -e ${RSERVER} has ${APEX_PKG}:"
  ssh ${RSERVER} "R --slave -e 'as.logical(suppressWarnings(suppressPackageStartupMessages(require(${APEX_PKG}))))'"
  echo # newline
done

which works. I'd still like to know:

> 2 What should my admin have done to install both Rscript and R?
>   (Alternatively, what should I tell my admin to do in order to make
>   both Rscript and R available?)

> 3 Is there any reason to install R without Rscript? (Alternatively,
>   when I ask my admin to install Rscript, is there any objection
>   I should anticipate?)

your assistance is appreciated, Tom Roche <Tom_Roche at pobox.com>