Skip to content
Prev 304805 / 398506 Next

[newbie] scripting remote check for R package

https://stat.ethz.ch/pipermail/r-help/2012-September/322985.html
https://stat.ethz.ch/pipermail/r-help/2012-September/323000.html
https://stat.ethz.ch/pipermail/r-help/2012-September/323024.html
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:
your assistance is appreciated, Tom Roche <Tom_Roche at pobox.com>