[R] Finding dependancies?

Uwe Ligges ligges at statistik.tu-dortmund.de
Fri Aug 12 16:57:07 CEST 2011



On 03.08.2011 09:03, Rainer M Krug wrote:
> Hi
>
> although the background is that it happened on an hpc cluster, this question
> does *not* concern hpc computing with R.
>
> I was using R on a cluster and had to install several packages in my home
> directory. Now the head node was migrated to new hardware (new install as
> well) and many dependencies for my in $HOME installed packages, which were
> present on the old head, are missing on the new head. Now I could simply try
> to run my script, wait for the error message, mail the administrator to
> install the package, try again, ... . But this is a tedious process - and I
> can not go to him directly, as I am sitting opn a different continent.
>
> So my question: is there an easy way (like ldd for programs), to identify
> the dependencies which are not met, and how could I use that on the
> packages?
>
> Thanks,
>
> Rainer


1. Identify the packages you are using in your code. I.e. watch out for 
library() and require() calls.


2.

Way A)

Tell the administrator to run
  install.packages(c("packageA", "packageB", .....), dependencies=TRUE)
and he or she will install all the dependencies (including suggests) in 
one pass.

Way B)

You can identify the dependencies by function package.dependencies() in 
package tools.

Way C)

Same as Way A) but just do it yourself into a private library, if you 
have the permissions.



Uwe Ligges



More information about the R-help mailing list