.r

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

  1. Confirm the file really is a .r. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
  2. On Windows, open it with RStudio or VS Code.
  3. On Mac, use RStudio or VS Code.
  4. On Linux, try RStudio or VS Code.
  5. 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.

Learn more about .r