How to Set the R_Home Environment Variable to the R Home Directory

How can I set R.HOME() and/or R_HOME correctly?

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

Change home directory for R

This is based on your windows environment variable HOME. You need to reset HOME to the path that you want "C:/Users/MyName/Documents"

If you want to do that from within R, you can use:

Sys.setenv(HOME="C:/Users/MyName/Documents")

This change would not be permanent. If you wish to avoid doing this every time you run R, you could put the above statement in your .Rprofile file. There is a nice article on setting up your .Rprofile in the RStudio support

When I call packages from rpy2 it gives me an error

  1. Search for the path of your R installation (e.g. C:\Program Files\R\R-3.6.1)
  2. Use the following code before importing rpy2:

    import os
    os.environ['R_HOME'] = "C:\Program Files\R\R-3.6.1" #or whereever your R is installed

This works for me (but only temporarily)

BlueSky Statistics: Error setting the “R_HOME directory path” preventing its start

The missing dll file is already in the newest BlueSky-Statistics-Open-Source-x64-v6.30.7341.34565.exe. Please try the following
Try this, please rename the "R-core" to say "R-core2" under HKEY_CURRENT_USER\SOFTWARE\
And now launch the BlueSky Statistics application.

If you still see the issue rename the other "R-core" as well, under HKEY_LOCAL_MACHINE\SOFTWARE\

And now launch the BlueSky Statistics application.



Related Topics



Leave a reply



Submit