[R] Failure loading library into second R 2.3.1 session on Windows XP

Henrik Bengtsson hb at stat.berkeley.edu
Sat Dec 30 01:02:41 CET 2006


Hi,

it sounds like you mixing up the words "install" and "load".
Basically, you only have to *install* a package once on your computer,
but have to load it for every R session which you are going to use it
in.

So, in your case install it once, using either

 install.packages("corpcor")

or the corresponding menu in RGui (on Windows), and then use

 library(corpcor)

every time you want to *load* the package (typically once per R session).

See "An Introduction to R" for further explainations.

Details: When you try to install a package a second time the previous
installation is overwritten. However, if another R session has the
same package loaded, some of the files of the package might be looked,
and won't be released until the package is unloaded or you quit the R
session.  Thus, when you try to install the package a second time (in
another R session or even the same) it will not work.  This is
expected.

Hope this helps

Henrik


On 12/30/06, Talbot Katz <topkatz at msn.com> wrote:
> Hi Uwe.
>
> Thank you so much for responding!  I guess I wasn't entirely clear about the
> problem.  If I make the mistake of trying to install a package from CRAN in
> a second session after I've already installed it in a previous session, it
> won't install in the second session, and even if I close the second session
> and open a subsequent newer session, it won't install in that one either.
> At least, I can't figure out how to do it, because it's no longer in the
> "Load packages..." menu, and if I load it from CRAN, I get that funny error
> message:
>         Warning: cannot remove prior installation of package 'corpcor'
>
> Now, after having gone through this, I know enough not to reload a package
> from CRAN.  But it appears that the only ways to solve the problem, if it
> occurs, are pretty drastic, either reboot the machine (which is what I did)
> or reinstall R (which seems to be what you're suggesting?).  I was hoping
> that there might be a better alternative, or at least that the development
> team might look into this issue for future releases.  This doesn't affect
> every package, but I've seen it in the first two packages I tried it with.
>
> --  TMK  --
> 212-460-5430    home
> 917-656-5351    cell
>
>
>
> >From: Uwe Ligges <ligges at statistik.uni-dortmund.de>
> >To: Talbot Katz <topkatz at msn.com>
> >CC: r-help at stat.math.ethz.ch
> >Subject: Re: [R] Failure loading library into second R 2.3.1 session on
> >Windows XP
> >Date: Fri, 29 Dec 2006 23:05:15 +0100
> >
> >You can only expect that update / reinstall a ***package*** works if you
> >have not yet loaded it into your R session.
> >Hence close R, start it without loading the relevant package and then
> >update/reinstall.
> >
> >Best,
> >Uwe Ligges
> >
> >
> >Talbot Katz wrote:
> >>Hi.
> >>
> >>I am using R 2.3.1 on Windows XP.  I had installed a library package into
> >>my first session and wanted the same package in my second session, so I
> >>went out to the CRAN mirror and tried to install the package, and got the
> >>following message:
> >>
> >>*********************************************************************
> >>
> >>>utils:::menuInstallPkgs()
> >>trying URL
> >>'http://cran.ssds.ucdavis.edu/bin/windows/contrib/2.3/corpcor_1.4.4.zip'
> >>Content type 'application/zip' length 133068 bytes
> >>opened URL
> >>downloaded 129Kb
> >>
> >>package 'corpcor' successfully unpacked and MD5 sums checked
> >>Warning: cannot remove prior installation of package 'corpcor'
> >>
> >>The downloaded packages are in
> >>         C:\Documents and Settings\Talbot\Local
> >>Settings\Temp\RtmplCxarb\downloaded_packages
> >>updating HTML package descriptions
> >>>library(corpcor)
> >>Error in library(corpcor) : there is no package called 'corpcor'
> >>
> >>*********************************************************************
> >>
> >>
> >>After rebooting my machine, I dug into this a little further.  Upon
> >>installing a package from a CRAN mirror, it seems to stay on my hard
> >>drive, and I can load it in subsequent sessions from the "Load package..."
> >>menu without going back to get it from a CRAN mirror.  However, if I do
> >>happen to retrieve it again from a CRAN mirror, it appears that may
> >>corrupt the version that was saved, and it no longer will be available
> >>from the "Load package..." menu.  A reboot and re-retrieval of the package
> >>makes it available again; I don't know whether there's any less drastic
> >>solution.
> >>
> >>This behavior doesn't occur with every package, but I have experienced it
> >>with two different packages (corpcor and copula), so there seems to be
> >>something going on.  I didn't see anything in the FAQ page about this, I
> >>wonder if anyone can tell me more about this issue.
> >>
> >>Thanks!
> >>
> >>
> >>--  TMK  --
> >>212-460-5430  home
> >>917-656-5351  cell
> >>
> >>______________________________________________
> >>R-help at stat.math.ethz.ch 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.
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>



More information about the R-help mailing list