Rich Shepard
2020-May-14 18:18 UTC
[R] Automating package updates after major version change
On Thu, 14 May 2020, Sarah Goslee wrote:> Note that install.packages requires "character vector of the names of > packages whose current versions should be downloaded from the > repositories" as stated in the help file.Sarah, Ah, yes. I missed that.> If you aren't going to do it the way I did, then you need to read your > text file into R and create that character vector there.I tried to translate your MacOS R commands to my linux system but failed in my attempts. I'll create a one-line list of packages, demarked as strings, and read that into R as a vector. Thanks, Rich
Sarah Goslee
2020-May-14 18:24 UTC
[R] Automating package updates after major version change
If you don't mind, I'm curious what didn't work - I would like to be able to update the document accordingly. When you used .libPaths() what did it tell you? Did you edit that result to be for the previous version, and swap that into the list.files() command? I thought about automating it, but I can't be sure what previous version you're upgrading from. I suspect you tried to run the code by copy and paste, and not by putting in your own path, but if so then I'd like to improve the directions. Sarah On Thu, May 14, 2020 at 2:19 PM Rich Shepard <rshepard at appl-ecosys.com> wrote:> > On Thu, 14 May 2020, Sarah Goslee wrote: > > > Note that install.packages requires "character vector of the names of > > packages whose current versions should be downloaded from the > > repositories" as stated in the help file. > > Sarah, > > Ah, yes. I missed that. > > > If you aren't going to do it the way I did, then you need to read your > > text file into R and create that character vector there. > > I tried to translate your MacOS R commands to my linux system but failed in > my attempts. > > I'll create a one-line list of packages, demarked as strings, and read that > into R as a vector. > > Thanks, > > Rich > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.-- Sarah Goslee (she/her) http://www.sarahgoslee.com
Rich Shepard
2020-May-14 18:42 UTC
[R] Automating package updates after major version change
On Thu, 14 May 2020, Sarah Goslee wrote:> If you don't mind, I'm curious what didn't work - I would like to be > able to update the document accordingly.Sarah, Here's part of the sequence:> install.packages('packagelist')Warning message: package ?packagelist? is not available (for R version 4.0.0)> source('newversionupdate.R')Error in install.packages(packagelist) : object 'packagelist' not found> .libpathError: object '.libpath' not found> .libpath()Error in .libpath() : could not find function ".libpath"> .libpaths()Error in .libpaths() : could not find function ".libpaths"> libpaths()Error in libpaths() : could not find function "libpaths"> ?libpathsNo documentation for ?libpaths? in specified packages and libraries: you could try ???libpaths?> ?libpaths()Error in .helpForCall(topicExpr, parent.frame()) : no methods for ?libpaths? and no documentation for it as a function> ?.libpaths()> When you used > .libPaths()Oops! I missed the uppercase 'P'.> .libPaths()[1] "/usr/lib64/R/library"> what did it tell you? Did you edit that result to be for the previous > version, and swap that into the list.files() command? I thought about > automating it, but I can't be sure what previous version you're > upgrading from.When I upgrade a package, such as R, the old version is removed. My library has remained the same over many R package upgrades.> I suspect you tried to run the code by copy and paste, and not by putting > in your own path, but if so then I'd like to improve the directions.No, you're running a different OS than I do so I didn't copy and paste. I'll get back to this after finishing a document edit that has the highest priority now. Thanks, Rich