Nepedia
Back to Discover
Advanced Reader
💻

R (programming language)

technology Maturity 7-9 war conflict Next article →

This article covers sensitive topics: war_conflict. Parents can manage visibility in Parental Controls.

R is a specialized programming language designed for statistical computing and data visualization. It allows users to perform complex mathematical tasks and create detailed charts to represent information. Because of these capabilities, R is widely used in many scientific fields. These include data science, bioinformatics, data mining, and general data analysis. R is free and open-source software. This means its source code is available for anyone to see and modify under the GNU General Public License.

RConsortiumLogo
RConsortiumLogo

The technical foundation of R is quite robust. The language is implemented primarily using C, Fortran, and the R language itself. It is an interpreted language, which means code is executed directly by a command line interface. While many users work through this text-based interface, others prefer graphical user interfaces (GUIs). Popular third-party applications include RStudio, which is an integrated development environment. Other options include Jupyter, which provides a notebook interface. For those using mobile devices, tools like Termux and Google Colab are also available.

CD of R 1 0 0
CD of R 1 0 0

One of the most powerful features of R is its system of packages. A package is a collection of reusable code, documentation, and sample data. These packages expand what the core language can do. There are base packages that come installed immediately. These provide the fundamental syntax, arithmetic, and basic statistical functions. Beyond the base, users can install specialized collections. For example, the tidyverse is a popular collection of packages. It helps users with visualizing, transforming, and modeling data. The tidyverse is designed to work with "tidy data." This refers to data organized into a two-dimensional table with single rows for observations and single columns for variables.

To use these tools, a user must first install them. For instance, one might use the command `install.packages("tidyverse")`. This installation only needs to happen once. After installation, the user must load the package to use its functions. This is done using the `library()` function, such as `library(tidyverse)`. To manage these vast amounts of code, the Comprehensive R Archive Network (CRAN) was established. Founded in 1997 by Kurt Hornik and Friedrich Leisch, CRAN hosts source code, executables, and user-created packages. CRAN has grown immensely since its start. It began with only three mirror sites and twelve packages. Today, it maintains 90 mirrors and hosts 22,390 contributed packages.

Ggplot2 PlantGrowth violin plot
Ggplot2 PlantGrowth violin plot

The history of R is tied to academic teaching. Professors Ross Ihaka and Robert Gentleman started the project at the University of Auckland. They originally intended it as a tool to teach introductory statistics. The language was inspired by the S programming language. In fact, most S programs can run in R without any changes. R also took ideas from a language called Scheme, specifically its lexical scoping. This allows for the use of local variables. The name "R" is a clever tribute. It represents both the successor to S and the shared first letter of the authors, Ross and Robert. In August 1993, the first binary files were posted to the StatLib archive. R later became a GNU project in December 1997. The version 1.0 was officially released on February 29, 2000.

Advanced users often utilize R for complex modeling and object-oriented programming. R supports two native frameworks for object-oriented programming: S3 and S4. The S3 system is more informal and uses a "class" attribute. The S4 system is more formal and supports multiple inheritance. R also excels at mathematical modeling. Users can create linear regression models to study relationships between variables. For example, the `lm()` function can generate a model from data. Users can then create diagnostic plots to inspect their results.

Plots from lm example
Plots from lm example

Recent updates have also improved how people write code. Since version 4.1.0, R includes a native pipe operator, `|>`. This allows users to chain functions together in a sequence. This makes code much easier to read compared to nested function calls.

Because R is so central to science, a large community supports it. There are three main groups that help maintain the software. The R Core Team was founded in 1997 to maintain the source code. The R Foundation for Statistical Computing was founded in April 2003 to provide financial support. Finally, the R Consortium is a Linux Foundation project that develops R infrastructure.

UseR Logo
UseR Logo

The community also gathers at many events. These include the annual UseR! conference and the SatRdays conferences. There are even groups like R-Ladies, which works to promote gender diversity. You can even see the power of R through visual math, such as the creation of a Mandelbrot set.

Mandelbrot Creation Animation
Mandelbrot Creation Animation
754 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (6)
File:Ggplot2 PlantGrowth violin plot.svg
Ggplot2 PlantGrowth violin plot.svg
RConsortiumLogo.webp
File:UseR Logo.png
UseR Logo.png
File:Plots from lm example.svg
Plots from lm example.svg
File:Mandelbrot Creation Animation.gif
Mandelbrot Creation Animation.gif
File:CD of R 1 0 0.png
CD of R 1 0 0.png
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.