You are not logged in.
I use R studio IDE to write my R code.
R read two configuration files, Renviron and Rprofile, when the session starts. The variables are correctly spread when I start the session with my shell (zsh). Unfortunately, R studio doesn't read them.
Does anyone know how to tell R studio to read them. RStudio starts R a bit differently than running R from the terminal. Technically, RStudio doesn’t “start” R, it uses R as a library.
Last edited by gabx (2024-09-20 08:44:50)
Offline
My .Rprofile file is located at an unusual place, the ~/.config/r directory. The usual place is ~/.Rprofile. The location of the file is indicated by the R_PROFILE_USER variable, which is exported in my environment, as indicated by the output of the following command:
> Sys.getenv("R_PROFILE_USER")
The above command returns the correct path "/home/gabx/.config/r/.Rprofile" when ran from a R session started from my shell, but returns empty from a R studio session.
To let R studio read the file, this one has to be placed in the regular place ~/.Rprofile
Offline