4

When I start R it’s meant to read from /etc/Rprofile.site first thing. I’ve verified that this isn’t happening but have no idea why or how to fix it. When I source('/etc/Rprofile.site') at startup everything goes fine.


Some random things I thought to investigate, which may be useful for someone who wants to help or may be irrelevant…

$ which R
/usr/bin/R

$ ls -l /usr/bin/R
-rwxr-xr-x 1 root root 8589 … /usr/bin/R

(nothing fishy hiding in a pointer/softlink so that’s not it)

$ echo $R_HOME

$ less ~/.Renviron
/home/isomorphismes/.Renviron: No such file or directory

> Sys.getenv("R_HOME")
[1] "/usr/lib/R"

> Sys.getenv("RHOME")
[1] "~/R/i686-pc-linux-gnu-library/"
isomorphismes
  • 1,864
  • 2
  • 20
  • 31
  • Did you ever figure this out? I'm seeing the same thing for R on RHEL 7 – Mark Nielsen Oct 11 '17 at 21:54
  • R wouldn't read the `.Rprofile` in my home directory. My solution was to go to `/usr/lib/R/etc` and create a softlink there: `sudo ln -sf ~/.Rprofile`. Not sure if this is the way to do it, but it works. – mindlessgreen Aug 26 '18 at 15:58

1 Answers1

2

You should try to see what R thinks its R_HOME (or RHOME) is. Try to run

R RHOME

that should print the value of RHOME and exit.

Alternatively, from the R command line

Sys.getenv("R_HOME")

I think R will read the startup and conf files from $(R RHOME)/etc/

Maybe it's not the location you think it is... Hope this helps

Regards

fra_pont
  • 31
  • 1