To set the required environment variables you should add them to the R environment file (which is read by R at startup). On RStudio Server this file is found at R_HOME/etc/Renviron.site. On RStudio Desktop this file is found in the user home directory at ~/.Renviron. You can easily access your .Renviron file by running the command file.edit('~/.Renviron') within RStudio
Note that these files might not exist in the default installation of R so you may need to create them if they aren’t already present.
Navigate to ‘Rprofile.site’, open it in text-editor.
insert right at the top of the file in the first line the following command which tells R to set the working directory at start-up to the PATH you are specifying within the brackets (be sure you use double backslashes “\” for Windows!)
Lorem ipsum dolor sit amet, vivamus quis, urna ligula, aliquet wisi fermentum pellentesque. Vestibulum euismod erat urna vestibulum, per cras tempus bibendum vestibulum, cras a, mus et. Ultrices adipiscing dolor, pellentesque neque nunc eros, sit etiam quam a. Mattis magna sem sed faucibus, luctus nec egestas mauris et in est, quam libero, facilisis metus tempor dolor aenean, cursus eget venenatis faucibus lectus ante. Et ac qui et scelerisque ac, nulla in, rhoncus a imperdiet, dui ac eu euismod sed sit libero. Felis mauris quis magna felis inceptos, non magna praesent velit enim tellus et. Sed ultricies per ac ipsum pellentesque nascetur, scelerisque habitant eget cras, leo est donec. Repellat viverra pulvinar in, eros sed ipsum est, quis turpis ridiculus porttitor lectus est et, est dapibus arcu non mauris tellus. Consequat neque est donec omnis ut odio, semper a faucibus mus purus.