My system: Mac OS 10.5.4.
Current R version: 2.7.1
Thanks for any suggestions. My apologies if this has been answered
before and my search missed it.
Jim Milks
Degree Candidate
______________________________________________
R-h...@r-project.org 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.
> The title says it all. Does anyone know of a way to save your
> packages when you upgrade to a new version of R? This may seem
> petty, but I'm accumulating enough packages that having to download
> and install each of them anew every time I install a new version of
> R is rather of a pain. Ideally, I would like the new version of R
> to recognize the packages I've installed on the previous version
> without needing to reinstall the packages. Is that possible?
>
> My system: Mac OS 10.5.4.
> Current R version: 2.7.1
Mac OS moves in mysterious ways, but apparently your installation
moves in more mysterious
ways than most.
I also (by necessity, not by choice) run Mac OS. But I certainly
don't lose my
packages when I update R. The new version of R certainly
``recognizes'' the packages
that I have installed. No action required.
There may be something funny about *where* you have your packages
installed, and
what environment variables you have set.
To answer your question ``Is that possible?'' --- Yes. Not just
possible,
but universal. Except, it would seem, in your case. What have you done
to offend the gods? :-)
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
Actually have had the same problem as James. By default, unless I'm
mistaken, R will save installed packages within the "R.framework"
framework (system-wide installation). This framework gets completely
replaced when a new version is installed. In my system, the location
of these packages is:
/Library/Frameworks/R.framework/Resources/library
So unless I am mistaken you have to take some action to prevent
packages from being installed there. I do hope I am wrong.
> cheers,
>
> Rolf Turner
>
Haris Skiadas
Department of Mathematics and Computer Science
Hanover College
I'm not sure --- I find Mac OS very confusing. But I have the
***impression*** that
(on my system) by default packages get installed into
~/Library/R/2.7/library
i.e. into a library inside the directory tree rooted in my login
directory.
I don't use this --- I've created my own library ~/Rlib and have
set up an environment variable to point to it.
(This works properly only if you start R from the command line; for
reasons I don't understand if you start R by clicking on the icon
then R doesn't know about the R_LIBS environment variable. But since
all civilized people start R from the command line .....)
I have no idea why youse guys' systems would eschew using ~/Library/
<whatever>.
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
______________________________________________
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
spe...@stat.berkeley.edu
HTH,
Thierry
------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry....@inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey
~/Library/R/2.7/library
directory.
cheers,
Rolf Turner
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document
# To reinstall packages from one R version to the next:
#Currently you can do
tmp <- installed.packages()
installedpkgs <- as.vector(tmp[is.na(tmp[,"Priority"]), 1])
save(installedpkgs, file="c:/R/installed.rda")
#in the old version to get a list of packages you installed. Then in the
#new version,
load("c:/R/installed.rda")
install.packages(installedpkgs)
--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT M3J 1P3 CANADA
But this is an FAQ, with a cleaner answer in the rw-FAQ. It really is
much easier to make use of a separate library for the additional packages
you install (and there is no need to reinstall packages when going from
2.7.1 to 2.7.2, which helps if you have hundreds or even thousands
installed -- a complete reinstall on our 32-bit Linux server took about
5 hours when we did it for 2.7.0).
--
Brian D. Ripley, rip...@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
For example
my.pkgs <- c('pkg1', 'pkg2') ## and so on for my preferred packages
install.packages(my.pkgs, dependencies=TRUE)
Then after each upgrade just source the script.
You will need to create a second list if you use any packages for
which binaries are not available.
Creating the list the first time might be inconvenient .... but
thereafter it's easy.
Additional benefits include
you can use the script when you get a new machine
you can use the script when a friend or colleague decides to try
R, and you want them to have the same packages
you can use the script if you maintain R on more than one platform, as I do
A downside would be if you have a huge number of packages and it
takes a long time to update them all. But even then, since most
packages are available as binaries, it should be reasonable.
Installing a huge number from source will take a long time.
This method is also a little tricky if you have locally written packages.
-Don
--
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
925-423-1062
>On a windows machine you get the same problem. Useless one uses tha same
>trick as Rolf suggested: don't install the packages in the default
>directory and set R_LIBS to that directory. Then all you need to do
>after an upgrade is to set R_LIBS in the new version and run
>update.package(checkBuilt = TRUE). Given Rolf's suggestion I suppose
>this trick will work on a Mac too.
What I do in installing a new version of R on a Windows system is as follows:
1. In the "c:\Program Files\R" folder, the installation is in a
subfolder labeled by the version, such as "R-2.7.1".
2. I leave the old (say, 2.7.1) version installed, and install the
new version (say, 2.7.2). This leaves the old subfolder "R-2.7.1"
intact, and creates a new one "R-2.7.2".
3. I use a file-compare utility (in my case, Beyond Compare, which I
recommend), to compare the subfolders "C:\Program
Files\R\R-2.7.1\library" and "C:\Program Files\R\R-2.7.2\library". I
set the comparison to find files present or newer in the 2.7.1 folder
vs. the 2.7.2. Then I copy all such files over.
4. At this point, the 2.7.2 has the same or new packages than 2.7.1,
most or all of which will work.
5. I use the "Packages|Update Package ..." to update packages to 2.7.2.
6. Then I delete the 2.7.1 subfolder.
You need Administrator rights to do this.
================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: r...@lcfltd.com
Least Cost Formulations, Ltd. URL: http://lcfltd.com/
824 Timberlake Drive Tel: 757-467-0954
Virginia Beach, VA 23464-3239 Fax: 757-467-2947
"Vere scire est per causas scire"
After I enter the R interface, I find .libPaths() can add a new location
for installed packages:
> .libPaths("d:/progra~1/R/Rlibs")
> .libPaths()
[1] "d:/progra~1/R/Rlibs" "D:/PROGRA~1/R/R-27~1.2/library"
Then the install.packages will install the packages into the first
directory. But after I restart R, I have to set it again. I cannot find
some configuration file to set it permanently.
Regards,
Leon
______________________________________________
Bart
--
View this message in context: http://www.nabble.com/Upgrading-R-means-I-lose-my-packages-tp19193056p19216548.html
Sent from the R help mailing list archive at Nabble.com.