Sys.getenv returns RSTUDIO_USER_IDENTITY and USER environment variables. Does anyone have an explanation of what these environment variables do?
Asked
Active
Viewed 91 times
0
-
I should also mention that I am running RStudio in server mode accessing it through a web browser. – Leon Katsnelson Sep 11 '16 at 21:16
1 Answers
0
USER
is a system environment variable unrelated to RStudio. It's what you should use to pick up the current system username (i.e the username of the user running the R session).
RSTUDIO_USER_IDENTITY
is generally the same as USER
, though it can differ in debug configurations. You probably want to use USER
unless you have a very specific reason to do otherwise.

Jonathan
- 8,497
- 41
- 35