Ted Byers
2010-Apr-29 20:52 UTC
[R] Upgrade process for libraries: can I use installed.packages on an old installation followed by install.packages in a new one
I tend to have a lot of packages installed, in part because of a wide diversity of interests and a disposition of examining different ways to accomplish a given task. I am looking for a better way to upgrade all my packages when I upgrade the version of R that I am running. On looking at support for installing and updating packages, I found these two: installed.packages() and install.packages() and it occurred to me that in principle I ought to be able to use the one in the original installation to get a list of packages I'm working with and and put its output into a plain text file that I can read in the new installation and pass to the other to ensure the new installation has a fresh installation of all the packages I want to work with. The question comes WRT the fact the output from installed.packages() does not coincide with the expected input for install.packages(). What would you recommend I do to select from the output from the former so the file I write that output to will have the information the latter wants for input? For example, will it work properly if I just write the package names installed.packages() returns to the file and ignore all the rest? It is not clear to me how I'd have it ignore those packages that are part of the core of R (or even if I need to worry about that - I did see some packages listed in the output from installed.packages() that are identified as being part of R 2.10.1, when I looked at using this procedure to set up R 2.11.0). NB: I am not suggesting the output from the one should coincide with the expected input for the other. Rather, I am asking advice on writing simple R scripts that I can run in the one to get a file that would be suitable input for the other that would together make a fresh installation of a new version automatically make a fresh installation of all the previously installed packages. Thanks Ted PS: I am using Windows XP, if that matters. [[alternative HTML version deleted]]
Erik Iverson
2010-Apr-29 20:59 UTC
[R] Upgrade process for libraries: can I use installed.packages on an old installation followed by install.packages in a new one
Ted Byers wrote:> I tend to have a lot of packages installed, in part because of a wide > diversity of interests and a disposition of examining different ways to > accomplish a given task. > > I am looking for a better way to upgrade all my packages when I upgrade the > version of R that I am running. > > On looking at support for installing and updating packages, I found these > two: installed.packages() and install.packages() and it occurred to me that > in principle I ought to be able to use the one in the original installation > to get a list of packages I'm working with and and put its output into a > plain text file that I can read in the new installation and pass to the > other to ensure the new installation has a fresh installation of all the > packages I want to work with.I must be missing the obvious, but what's wrong with update.packages() ?
Greg Snow
2010-Apr-30 18:04 UTC
[R] Upgrade process for libraries: can I use installed.packages on an old installation followed by install.packages in a new one
There exists a set of batchfiles for windows (they have been mentioned several times on this list before, searching the archives should give you their location) that will move or copy the installed packages from the folder for an old R installation to the folder for your new installation without overwriting the packages already present in the new installation. You can then use update.packages (with the checkbuilt or similar argument set to TRUE) in the new installation to make sure that you have compatible versions of the packages. This is probably the easiest/fastest solution for windows. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.snow at imail.org 801.408.8111> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Ted Byers > Sent: Thursday, April 29, 2010 2:52 PM > To: R-help Forum > Subject: [R] Upgrade process for libraries: can I use > installed.packages on an old installation followed by install.packages > in a new one > > I tend to have a lot of packages installed, in part because of a wide > diversity of interests and a disposition of examining different ways to > accomplish a given task. > > I am looking for a better way to upgrade all my packages when I upgrade > the > version of R that I am running. > > On looking at support for installing and updating packages, I found > these > two: installed.packages() and install.packages() and it occurred to me > that > in principle I ought to be able to use the one in the original > installation > to get a list of packages I'm working with and and put its output into > a > plain text file that I can read in the new installation and pass to the > other to ensure the new installation has a fresh installation of all > the > packages I want to work with. > > The question comes WRT the fact the output from installed.packages() > does > not coincide with the expected input for install.packages(). What > would you > recommend I do to select from the output from the former so the file I > write > that output to will have the information the latter wants for input? > For > example, will it work properly if I just write the package names > installed.packages() returns to the file and ignore all the rest? It > is not > clear to me how I'd have it ignore those packages that are part of the > core > of R (or even if I need to worry about that - I did see some packages > listed > in the output from installed.packages() that are identified as being > part of > R 2.10.1, when I looked at using this procedure to set up R 2.11.0). > > NB: I am not suggesting the output from the one should coincide with > the > expected input for the other. Rather, I am asking advice on writing > simple > R scripts that I can run in the one to get a file that would be > suitable > input for the other that would together make a fresh installation of a > new > version automatically make a fresh installation of all the previously > installed packages. > > Thanks > > Ted > > PS: I am using Windows XP, if that matters. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.
Apparently Analagous Threads
- library/function that estimates parameters of well known distributions from empirical data?
- Novice question about getting data into R
- Can I create a timeDate object using only year and week of the year values?
- The time series analysis functions/packages don't seem to like my data
- Why isn't R recognising integers as numbers?