.r

What is a .r file?

R is the language of statisticians — purpose-built for data analysis, visualisation, and statistical computing.

Use caution
Type Code
By Ross Ihaka / Robert Gentleman
MIME text/x-r

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

R exists because statisticians needed a programming language designed by statisticians, for statisticians. The language treats data frames, vectors, and statistical functions as first-class citizens. Need a t-test? It's built in. Want a publication-ready scatter plot? Three lines of code. Need to fit a mixed-effects model? There's a package for that.

The language dominates academic statistics, biostatistics, epidemiology, and social science research. ggplot2 (R's plotting library) produces visualisations so consistently beautiful that you can spot an R-generated chart across a crowded slide deck. RMarkdown weaves code, output, and prose into reproducible reports. The tidyverse collection of packages makes data manipulation almost readable.

RStudio (now Posit) is the IDE that makes R usable — interactive console, variable browser, plot viewer, and package manager in one interface. VS Code with R extensions is an alternative. R scripts are plain text, editable anywhere. Python's pandas and matplotlib have absorbed some of R's traditional territory, but for serious statistical analysis, R remains the specialist tool that generalist languages can't quite match.

Technical details
Full Name
R Script
MIME Type
text/x-r
Developer
Ross Ihaka / Robert Gentleman
Magic Bytes
N/A
Safety
.r requires caution. Script file. Safe to read but executes arbitrary code when run with the R interpreter.
What opens it
RStudio (Posit)
FREE Windows / Mac / Linux
VS Code (+ R extension)
FREE Windows / Mac / Linux
Any text editor
FREE Windows / Mac / Linux
FAQ
Should I learn R or Python?
Python for general-purpose programming and machine learning. R for statistics, biostatistics, and publication-quality visualisations. Many data scientists use both — Python for engineering, R for analysis.
What is ggplot2?
R's most popular plotting library, based on the Grammar of Graphics. It builds visualisations in layers (data, aesthetics, geometries) and produces publication-ready charts with minimal code. It's the reason many people learn R.
Related formats