[R] Dep setting for install of packages... Hopefully this is it this time
Brian Lunergan
ff809 at ncf.ca
Tue Oct 21 20:10:52 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")
Okay, I must be missing something. Switched back up to v2.8.0 running on
XP. Modified Rprofile.site as follows:
# Things you might want to change
# options(papersize="a4")
# options(editor="notepad")
# options(pager="internal")
# to prefer Compiled HTML help
options(chmhelp=TRUE)
# to prefer HTML help
# options(htmlhelp=TRUE)
# .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library")
# set a CRAN mirror
# local({r <- getOption("repos")
# r["CRAN"] <- "http://my.local.cran"
# options(repos=r)})
assignInNamespace("menuInstallPkgs", function (type =
getOption("pkgType")) {
install.packages(NULL, .libPaths()[1], dependencies = TRUE, type = type)
}, ns = "utils")
Saved the file and then opened Rgui. The following error appears:
Error: could not find function "assignInNamespace"
>
I'm guessing that means the program doesn't recognize the edit, but the
function did turn up when I ran ?assignInNamespace. I have no idea what
went wrong. Anybody more knowledgeable in the inner workings here care to
point me further on in the right direction, please?
--
Brian Lunergan
Nepean, Ontario
Canada
---
More information about the R-help
mailing list