R doesn’t always play nice with networked storage, and typically expects that users have admin rights when installing software. Problems can arise when installing R libraries in the default user location, and sometimes when knitting documents or performing disc-intensive operations. Users who are locked out by IT restrictions should follow the steps below when installing R and RStudio.

R file locations

On Windows, R is typically installed under C:/Program Files/R/. However, if you don’t have administrative privileges on your computer, you won’t be able to write to the /Program Files/ directory.

R’s great strength is the many libraries of functions available to simplify analysis. Under Windows, the default location for user-installed libraries is in the user’s documents folder, usually something like: C:/Users/<user_name>/Documents/R/win-library/3.42

On machines managed by a corporate IT department, the Documents folder is often stored on a server to provide automatic backups, and the local copy is mirrored from that server. In these cases, default location becomes something like //server/dir1/dir2/<user_name>/MyData/My Documents/R/win-library/3.42. Alternatively, some people may configure their computers to store their document folders in a directory synced to Dropbox or another online file storage service.

Step 1: Checking for a problem

How do you know if you’ll have a problem with the Program Files location? When you try to install R to /Program Files/, the installer will tell you that you “don’t have permission to save in this location.”

What about your Documents folder? From the Windows desktop (a.k.a. the “Explorer”), open a file window, right click on your “Documents” folder in the navigation pane, select “Properties.” If the “Location:” field starts with two slashes, you’re using network storage. Below are two screenshots showing what this would look like.

Screenshot showing Properties selection in context menu