Symptoms
Due to several static environmental variables in RStudio, the default install will not allow files to be saved to My Documents (the default home location). This can be seen by using the "setwd()" command to set it as the working directory and attempting to save the file. To resolve this, we must create a windows environmental variable named R_USER. The current environmental variable values can be seen in RStudio with the command "sys.getenv()".
Steps
After running the steps below, you should be able
Steps | Relevant Data and Screenshots |
---|---|
Create a new folder anywhere on your C:\ drive | |
In Search, search for and then select: Control Panel | |
Search for the Advanced system settings | |
Select Environment Variables | |
Under the User variables box, select New | |
Create a variable named R_USER and set the variable value to be the folder location you created in step one |
Related articles