How to open a .r file
Quick, free ways to open R on any system.
A .r file is a R Source File. If double-clicking does nothing, your computer simply does not have an app that reads R yet. Here is how to fix that on each operating system, using free software wherever possible.
Open a .r file step by step
- Confirm the file really is a .r. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
- On Windows, open it with RStudio or VS Code.
- On Mac, use RStudio or VS Code.
- On Linux, try RStudio or VS Code.
- Still stuck? Search for a dedicated R viewer.
Best apps to open .r files
Windows
- RStudio
- VS Code
- any text editor
macOS
- RStudio
- VS Code
- any text editor
Linux
- RStudio
- VS Code
- Rscript
!
Before you open it: Caution. An .r file is a script that runs when executed. Review unfamiliar scripts before running them.
Frequently asked questions
Why can't I open my .r file?
Almost always because no installed app understands R. Install one of the apps above, or convert the file to a format your existing software already reads.
How do I run an .r file?
Open it in RStudio and run it, or from a terminal run Rscript file.r with R installed.
What is the difference between .r and .rdata?
An .r (or .R) file is R source code. An .rdata or .rds file stores saved R data objects, not code, to reload later.