I have my R installed in C:\R\R-3.3.0
. But:
> R.home()
[1] "C:/R/R-33~1.0"
> Sys.getenv("R_HOME")
[1] "C:/R/R-33~1.0"
I think both should be "C:/R/R-3.3.0"
as I have quite a lot of trouble when using the debugger: It just does not find the libraries!
As I am on Windows, I read this in the documentation, but it did not help:
On Windows the values of R.home() and R_HOME are switched to the 8.3 short form of path elements if required and if the Windows service to do that is enabled. The value of R_HOME is set to use forward slashes (since many package maintainers pass it unquoted to shells, for example in ‘Makefile’s).
Help is higly appreciated, because my knowledge about environment variables is tiny.
You can find R_HOME by running the command R. home(component = "home") in a session of that version of R. So, for example, if you find that R_HOME is /opt/R/3.6.
The R home directory is the top-level directory of the R installation being run. The R home directory is often referred to as R_HOME , and is the value of an environment variable of that name in an R session. It can be found outside an R session by R RHOME .
Thanks to @Morgan I found the answer here:
The "short name" is really the old DOS 8.3 naming convention, so all the directories will be the first 6 letters followed by ~1 assuming there is only one name that matches
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With