LinuxmacOSWindows

Where Are RStudio Projects and Settings Stored?

RStudio projects are folders that contain an Rproj file and a project user state folder. User preferences live separately in an RStudio settings folder.

Last updated

A project is any folder with an Rproj file. Opening that file sets the working directory and project options for the session.

New projects default to a subfolder of the home directory. Global options, themes, keybindings, and snippets live in a settings folder outside the project.

Where RStudio stores this, by platform

Linux
~/<project>/<project>.Rproj

Replace <project> with the project folder name. The New Project dialog defaults to a subfolder of home. Project state lives in <project>/.Rproj.user. User settings live in ~/.config/rstudio/rstudio-prefs.json with subfolders for keybindings, snippets, themes, and dictionaries.

macOS
~/<project>/<project>.Rproj

Replace <project> with the project folder name. The New Project dialog defaults to a subfolder of home. Project state lives in <project>/.Rproj.user. User settings live in ~/.config/rstudio/rstudio-prefs.json. The path respects XDG_CONFIG_HOME when that variable is set.

Windows
C:\Users\<user>\Documents\<project>\<project>.Rproj

Replace <user> with the Windows account name and <project> with the project folder name. Home resolves to the Documents folder on many Windows installs, so the dialog often opens there. Project state lives in a .Rproj.user subfolder. User settings live in C:\Users\<user>\AppData\Roaming\RStudio\rstudio-prefs.json.

Frequently asked questions

How do I change the default new project location?

Choose a folder in the New Project dialog each time or set the default project location in Global Options. The initial working directory and default open project location are separate options in rstudio-prefs.json. Changing HOME on the system also changes where the dialog starts.

Which files should I back up or ignore in version control?

Back up rstudio-prefs.json plus keybindings, snippets, themes, and templates to preserve customization. Commit the Rproj file but ignore the .Rproj.user folder. That user folder holds window state and autosaves that should stay local.

Notice an outdated path? Let us know.