Target file of sys.setenv()

I have been reading about the differences between these files but can't find even in the sys.setenv() documentation which of these files the function is intended to modify? I know it can modify both the .Rprofile and .Renviron so how do we specify which of the two?

Great question! There are several places where you can set environment variables, especially when running R on a server. This allows you to set environment variables for specific projects, users, or all users on a server.

This article provides a great explanation and links to more detailed documentation, but here's a quick visual summary:

You can also read more about the differences between the various startup files here.

In addition to above: Please not that Sys.setenv() does alter neither .Rprofile nor .Renviron. It only changes the environment variable for the running process.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.