[R] Dep setting for install of packages... EOT (I think) and my thanks

Brian Lunergan ff809 at ncf.ca
Mon Oct 20 15:32:21 CEST 2008

Gabor Grothendieck wrote:
> leaps is not in Depends or Imports for car.  It is in Suggests
> and those don't get automatically pulled in when dependencies = NA.
> What you could do is to replace the builtin menuInstallPkgs with
> your own by running this:
> assignInNamespace("menuInstallPkgs", function (type = getOption("pkgType")) {
>     install.packages(NULL, .libPaths()[1], dependencies = TRUE, type = type)
> }, ns = "utils")
> You will need to do that in every session that you want to use the install
> menu or you could just add it to your Rprofile.site file which you
> can find by running this:
> file.path(R.home(), "etc", "Rprofile.site")

So, if I'm understanding this correctly, for a simple, one libpath() 
situation like mine dep = NA will catch depends and imports, while dep = 
TRUE will catch those two plus anything under suggests. From prior 
discussion and suggested reading I take it I would use dep = FALSE to catch 
the first two if I had multiple locations in libpath() while dep = TRUE 
behaviour would stay the same.

In putting the above code snippet into the Rprofile file, does it need to 
be all on one line or can it spread over multiple lines as it appears above?

My thanks for your time and patient assistance in finding the answers. It 
is very much appreciated and useful.


Brian Lunergan
Nepean, Ontario


More information about the R-help mailing list