I would call something like this via ssh (please note: I used "ggplot2" in
the example):

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

You could easily extend this to loop through the required packages and
tweak the output for your needs.

Best,
Gergely

On Sun, Sep 2, 2012 at 10:42 PM, Tom Roche <Tom_Roche@pobox.com> wrote:

>
> summary: e.g., how to replace '<query R for package=package_name>'
> in the following:
>
> for RSERVER in 'foo' 'bar' 'baz' ; do
>   ssh ${RSERVER} '<query R for package=package_name>'
> done
>
> or is there a better way to script checking for an R package?
>
> details:
>
> For my work I need a few non-standard R packages. I do that work on 2
> clusters. One uses environment modules, so any given server on that
> cluster can provide (via `module add`) pretty much the same resources.
>
> The other cluster, on which I must also unfortunately work, has
> servers managed individually, so I get in the habit of doing, e.g.,
>
> EXEC_NAME='whatever'
> for S in 'foo' 'bar' 'baz' ; do
>   ssh ${RSERVER} "${EXEC_NAME} --version"
> done
>
> periodically. I'm wondering, what incantation to utter (bash preferred)
> via ssh to query a given server's R for a given package?
>
> TIA, Tom Roche <Tom_Roche@pobox.com>
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

