R is a programming language for statistical computing and data visualization. It has been widely adopted in the fields of data mining, bioinformatics, data analysis, and data science. The core R language is extended by a large number of software packages, which contain reusable code, documentation, and sample data. Some of the most popular R packages are in the tidyverse collection, which enhances functionality for visualizing, transforming, and modelling data, as well as improves the ease of programming (according to the authors and users). R is free and open-source software distributed under the GNU General Public License. The language is implemented primarily in C, Fortran, and R itself. Precompiled executables are available for the major operating systems (including Linux, MacOS, and Microsoft Windows). Its core is an interpreted language with a native command line interface. In addition, multiple third-party applications are available as graphical user interfaces; such applications include RStudio (an integrated development environment), Jupyter (a notebook interface), as well as Termux and Google Colab for mobile devices.
History
R was started by professors Ross Ihaka and Robert Gentleman as a programming language to teach introductory statistics at the University of Auckland. The language was inspired by the S programming language, with most S programs able to run unaltered in R. The language was also inspired by Scheme's lexical scoping, allowing for local variables. The name of the language, R, comes from being both an S language successor and the shared first letter of the authors, Ross and Robert. In August 1993, Ihaka and Gentleman posted a binary file of R on StatLib — a data archive website. At the same time, they announced the posting on the s-news mailing list. On 5 December 1997, R became a GNU project when version 0.60 was released. On 29 February 2000, the 1.0 version was released.
Packages
R packages are collections of functions, documentation, and data that expand R. For example, packages can add reporting features (using packages such as R Markdown, Quarto, knitr, and Sweave) and support for various statistical techniques (such as linear, generalized linear and nonlinear modeling, classical statistical tests, spatial analysis, time-series analysis, and clustering). Ease of package installation and use have contributed to the language's adoption in data science. Immediately available when starting R after installation, base packages provide the fundamental and necessary syntax and commands for programming, computing, graphics production, basic arithmetic, and statistical functionality. An example is the tidyverse collection of R packages, which bundles several subsidiary packages to provide a common API. The collection specializes in tasks related to accessing and processing "tidy data", which are data contained in a two-dimensional table with a single row for each observation and a single column for each variable. Installing a package occurs only once. For example, to install the tidyverse collection:
To load the functions, data, and documentation of a package, one calls the library() function. To load the tidyverse collection, one can execute the following code:
The Comprehensive R Archive Network (CRAN) was founded in 1997 by Kurt Hornik and Friedrich Leisch to host R's source code, executable files, documentation, and user-created packages. CRAN's name and scope mimic the Comprehensive TeX Archive Network (CTAN) and the Comprehensive Perl Archive Network (CPAN). CRAN originally had only three mirror sites and twelve contributed packages. As of 30 June 2025, it has 90 mirrors and 22,390 contributed packages. Packages are also available in repositories such as R-Forge, Omegahat, and GitHub. To provide guidance on the CRAN web site, its Task Views area lists packages that are relevant for specific topics; sample topics include causal inference, finance, genetics, high-performance computing, machine learning, medical imaging, meta-analysis, social sciences, and spatial statistics. The Bioconductor project provides packages for genomic data analysis, complementary DNA, microarray, and high-throughput sequencing methods.
Community
There are three main groups that help support R software development:
The R Core Team was founded in 1997 to maintain the R source code. In 2026, it was awarded the Rousseeuw Prize for Statistics for its contributions to statistical research and impact on society. The R Foundation for Statistical Computing was founded in April 2003 to provide financial support. The R Consortium is a Linux Foundation project to develop R infrastructure. The R Journal is an open access, academic journal that features short to medium-length articles on the use and development of R. The journal includes articles on packages, programming tips, CRAN news, and foundation news.
The R community hosts many conferences and in-person meetups. These groups include:
useR!: an annual international R user conference (website) Directions in Statistical Computing (DSC) (website) R-Ladies: an organization to promote gender diversity in the R community (website) SatRdays: R-focused conferences held on Saturdays (website) Data Science & AI Conferences (website) posit::conf (formerly known as rstudio::conf) (website) uRos: an annual conference on the Use of R in Official Statistics (website) On social media sites such as Twitter, the hashtag #rstats can be used to follow new developments in the R community.
Examples
Hello, World! The following is a "Hello, World!" program:
Here is an alternative version, which uses the cat() function:
Basic syntax The following examples illustrate the basic syntax of the language and use of the command-line interface. In R, the generally preferred assignment operator is an arrow made from two characters <-, although = can be used in some cases.
Structure of a function R can create functions that add new functionality and enable code reuse. Objects created within the body of the function (which are enclosed by curly brackets) remain accessible only from within the function, and any data type may be returned. In R, almost all functions and all user-defined functions are closures. The following is an example of creating a function to perform an arithmetic calculation:
The following is some output from using the function defined above:
… excerpt ends here. Continue reading the full article.






