Why R persists
R was built by statisticians for statistics. Its modelling functions, diagnostics and visualisation grammar remain first class, and it dominates in biostatistics, epidemiology, econometrics and academic research.
Tidyverse idioms
dplyr verbs — filter, select, mutate, group_by, summarise — compose through the pipe into readable transformation chains. tidyr reshapes between wide and long; ggplot2 builds plots by layering a grammar of graphics onto mapped aesthetics.
library(dplyr); library(ggplot2)
daily <- orders |>
filter(status == "paid") |>
mutate(day = as.Date(created_at)) |>
group_by(day, country) |>
summarise(revenue = sum(total_cents) / 100,
buyers = n_distinct(customer_id), .groups = "drop")
ggplot(daily, aes(day, revenue, colour = country)) +
geom_line() +
labs(title = "Daily revenue by country", y = "Revenue")Modelling and reporting
lm() and glm() fit linear and generalised linear models with rich summary and diagnostic output. R Markdown and Quarto weave code, results and prose into a reproducible report — the natural artefact when the deliverable is an argument rather than a service.