[R] Automating package updates after major version change

Rich Shepard r@hep@rd @end|ng |rom @pp|-eco@y@@com
Thu May 14 20:42:58 CEST 2020


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
> .libpath
Error: 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"
> ?libpaths
No 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



More information about the R-help mailing list