You are not logged in.

#1 2024-09-20 06:30:47

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 179
Website

[SOLVED] R studio start-up files not recognized

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

#2 2024-09-20 08:44:23

gabx
Member
From: Geneva, Switzerland
Registered: 2011-11-20
Posts: 179
Website

Re: [SOLVED] R studio start-up files not recognized

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

Board footer

Powered by FluxBB