Managing Files
RStudio supports syntax highlighting and other specialized code-editing features for specific file types:
- Scripts in R, Python, SQL
- Computational and scientific documents in Quarto, R Markdown, and TeX
- Web content such as HTML and CSS
- and many more
Files tab
The Output pane has a Files tab that includes several buttons for managing files within the currently selected folder, including the New Blank File drop-down, Delete button, and the Rename button. These buttons will operate on files that are selected within the Files tab.
The More drop-down contains a number of other useful features:
- Copy or Move selected file(s) to a new location
- Open selected file(s) in Source pane or new columns
- Modify or navigate to the working directory
- Open a new terminal from the displayed folder
- Open the displayed folder in a new pop-out window
- Show hidden files
Existing files
To open existing files from the Files tab, use the Files tab to navigate to the folder that contains your file. Then click on the file of interest to open it in the Source pane of RStudio.
To modify existing files from the Files tab, select the checkbox next the file(s) of interest, then use the UI elements such as Delete or More > Move….
Switching files
If several files are opened within RStudio, then they are all available as tabs within the Source pane to facilitate quick switching between open documents.
Use the Ctrl+Tab and Ctrl+Shift+Tab shortcuts on desktop (Ctrl+F12 and Ctrl+F11 on Linux) to quickly move to the next or previous tabs, respectively.
If there are a large number of open documents, navigate between them using the “>>“ icon at the end of the tab bar (Ctrl+Shift+. shortcut or the View -> Switch to Tab... menu item). The Switch to Tab… provides a filtering search for all of the tabs in that Source pane:
To quickly navigate to any existing file in the current RStudio Project, even if it is not currently open, use the Ctrl + . shortcut. Entering the shortcut will bring up the Go to File/Function search bar with auto-completion of file names.