Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the R_LIBS_USER variable so that R appends the version number?

Tags:

r

By default (in Windows), R saves libraries to a path that is something like:

C:\Users\(username)\R\3.3

I would like to change the C:\Users\(username) part of that, but still allow R to assign the R\3.3 part. I.e., when I update R, it should start using R\3.4, etc..

You can change the entire install path by setting the environment variable R_LIBS_USER. Is there an environment variable for just the prefix?

like image 524
Jake Fisher Avatar asked Oct 24 '25 19:10

Jake Fisher


1 Answers

Use the pattern %v in the value of R_LIBS_USER. This is documented in the libPaths documentation.

Note that this only works if the path actually exists: .libPaths will ignore nonexistent paths.

like image 69
Konrad Rudolph Avatar answered Oct 26 '25 08:10

Konrad Rudolph



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!