R

A language and environment for statistical computing, data analysis, and publication-quality visualization.

Functional
Object-Oriented
Procedural
Intermediate
1993
Ross Ihaka, Robert Gentleman

Overview

R is a programming language and software environment for statistical computing and graphics. It provides a wide variety of statistical techniques and graphical techniques through its extensive package ecosystem (CRAN with 19,000+ packages).

Key Features

  • Statistical computing — Built-in support for statistical tests, models, and distributions
  • ggplot2 — Grammar of graphics for publication-quality visualization
  • CRAN — Over 19,000 contributed packages
  • R Markdown — Reproducible reports combining code, results, and narrative
  • Vectorized operations — Operate on entire vectors/matrices without explicit loops

Code Example

r
library(dplyr)
library(ggplot2)

mtcars %>%
  filter(mpg > 20) %>%
  group_by(cyl) %>%
  summarise(avg_hp = mean(hp), count = n()) %>%
  ggplot(aes(x = factor(cyl), y = avg_hp, fill = factor(cyl))) +
  geom_col() +
  labs(title = "Average HP by Cylinder Count (MPG > 20)")

Learning Resources

Learning Path

13 topics across 4 sections

1Basics

2Data Manipulation

3Visualization

  • ggplot2 — Grammar of Graphics, geoms, aesthetics, and themes
  • Interactive Plots — plotly, Shiny dashboards, and htmlwidgets
  • R Markdown — Reproducible reports, Quarto, and literate programming

4Statistics & ML