What Is R?
R is a programming language designed for statistics, data analysis, and data visualization. It was created by Ross Ihaka and Robert Gentleman at the University of Auckland, first released in 1993, and is free and open source.
heights <- c(162, 175, 181, 158, 170)
mean(heights)
[1] 169.2
Two lines: store five numbers, compute their average. That directness is typical of R. Its defining traits:
- Built for data — vectors, tables (data frames), missing values, and statistical functions are part of the language itself, not add-ons.
- Vectorized — operations work on whole collections at once:
heights * 2doubles every value, with no loop. - Interactive — you usually work in a console, running a line and seeing the result immediately, which suits exploring data.
- A huge package ecosystem — CRAN (the Comprehensive R Archive Network) hosts over 20,000 free packages, covering almost every statistical method ever published.
- Excellent graphics — R's
ggplot2package is one of the most respected tools for data visualization in any language.
This course targets R 4.x. The examples were run on R 4.6.