[R] Dep setting for install of packages... Hopefully this is it this time

Gabor Grothendieck ggrothendieck at gmail.com
Tue Oct 21 20:19:27 CEST 2008


Perhaps utils is not loaded at the time that the profile runs.
Try adding library(utils) before the assignInNamespace
command.

On Tue, Oct 21, 2008 at 2:10 PM, Brian Lunergan <ff809 at ncf.ca> wrote:
> 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
>
>
> ---
> avast! Antivirus: Outbound message clean.
> Virus Database (VPS): 081021-0, 2008-10-21
> Tested on: 2008-10-21 14:10:54
> avast! - copyright (c) 1988-2008 ALWIL Software.
> http://www.avast.com
>
>
>
>



More information about the R-help mailing list