0

I know there are plenty of ways to install packages but I obtained a zipped folder containing lots of folders with r packages. Is that ok to simply unzip the folder, copy all the folders and paste them to R-3.6.1\library location? Will that work properly?

Carl6455
  • 1
  • 1
  • 2
    It might, assuming the zip file came from a computer running R-3.6.1 and is being unzipped in a computer running R-3.6.1 and the architectures are identical and the "bit-ness" (32 or 64) of R is the same and the supporting libraries (not R) are all available and working and ... perhaps a few other things. Have you tried it? What works? What breaks? I'm inferring this is windows (based on your use of a backslash), in which case you must also have `Rtools35` installed (https://cran.r-project.org/bin/windows/Rtools/history.html) and visible to R. – r2evans Dec 23 '21 at 15:28
  • It might be better to `dir()` the directory to get the package names, go to github or where else they are maintained, download, carry manually to the other machine, and [install from source](https://stackoverflow.com/q/1474081/6574038) an [older version](https://stackoverflow.com/questions/17082341/installing-older-version-of-r-package) of the package. – jay.sf Dec 23 '21 at 17:44

1 Answers1

0

You're talking about the installed package folders that were built and installed on another computer?

You'd want to be sure they are from the same operating system and version of R.

It also depends if there are any unmet or potentially conflicting dependencies. If not, in theory it should work.

But you'll then get notified of package updates. So it will only save you time installing them in the first place.

You could always switch between the package libs location when starting RStudio, by setting the "R_LIBS_USER" environment variable. Then update those packages (and get a sense of how safe it is), and you'll probably run into less chance of issues when you soft-copy them across to your primary location.

And please backup the primary location first if you need to restore it to that point.