Skip to main content

R

Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/r-language

In short

R is a programming language and environment for statistics and data analysis, widely used in research for data visualization, statistical models and reports.

What is the R programming language?

R is a programming language and interactive environment built for statistical computing and graphics. It was created by Ross Ihaka and Robert Gentleman at the University of Auckland, first appeared in 1993 and is based on the earlier S language from Bell Labs. R is free and open source, part of the GNU project, and extended by thousands of community packages in the CRAN repository.

R is dynamically typed and vectorized, meaning operations work on whole vectors of values at once: c(1, 2, 3) * 2 returns 2 4 6 without a loop. Its central data structure is the data frame, a table where each column can hold a different type, which makes it natural for spreadsheet-like data. R counts from 1 instead of 0, and many users assign values with the <- arrow rather than =.

R is used by statisticians, data scientists and researchers in fields such as biology, medicine, economics and social science for exploring data, fitting statistical models, making publication-quality charts and producing reproducible reports that mix code and text. Working in R feels like walking into a well-equipped statistics lab: the tools for tests, regressions and plots are already on the bench instead of needing to be assembled first.

R is most often compared with Python for data work. Python is a general-purpose language that also has strong data libraries and dominates machine learning and production systems, while R is specialized for statistics, with a deeper catalog of statistical methods and very polished visualization tools. Many teams use both, and each can call the other through bridging packages.

Key takeaways

  • R is designed specifically for statistics, data analysis and graphics.
  • Operations are vectorized, so they apply to whole vectors without explicit loops.
  • Data frames are its core structure for tabular data.
  • CRAN hosts thousands of free packages that extend R.
  • Compared with Python, R is more specialized for statistics and less for general software.

Example

A data frame and vectorized operations in Rr
# A data frame: a table whose columns are vectors
scores <- data.frame(
  student = c("Ada", "Grace", "Linus", "Margaret"),
  score   = c(91, 78, 85, 96)
)

mean(scores$score)                   # 87.5
scores$passed <- scores$score >= 80  # vectorized comparison, no loop
subset(scores, passed)               # rows where passed is TRUE

# Summary statistics and a quick chart
summary(scores$score)
barplot(scores$score, names.arg = scores$student)

Readers ask

Is R a real programming language?

Yes. R has functions, loops, packages and several object systems, so it can express any program, but its design and libraries are centered on statistics and data analysis rather than general application development.

Should I learn R or Python for data science?

Python is more general-purpose and dominates machine learning and production code, while R excels at statistics, research and visualization. If you work mainly in academic research or statistics, R is a strong choice; otherwise Python is usually more versatile.

Why is it called R?

The name is partly a nod to its predecessor, the S language, and partly a reference to the first names of its creators, Ross Ihaka and Robert Gentleman.

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings