Skip to content

40 facts

40 Fun Facts About R Programming

Learn something new, then test yourself with the quiz.

Know these facts? Prove it.

Take the 40-question quiz
1

R was created in the early 1990s to teach statistics at a university in which Southern Hemisphere country?

New Zealand is where R began: two University of Auckland statisticians wanted a language for their introductory classes. They first posted it online in August 1993.

2

The R package that popularised the %>% pipe puns on the name of which surrealist painter of a famous pipe?

René Magritte painted The Treachery of Images, a pipe captioned "Ceci n'est pas une pipe". The package is called magrittr, and its official description quotes the line.

3

R releases carry codenames such as "Great Pumpkin" and "Masked Marvel", all nods to which comic strip?

Peanuts has supplied every R codename since Great Pumpkin, the first of them, which was released on Halloween 2011.

4

A classic built-in R dataset records fuel economy for 32 cars from a 1974 issue of which magazine?

Motor Trend is the "mt" in mtcars. Each car is listed with eleven measurements, including miles per gallon, horsepower, weight and quarter-mile time.

5

R is one of three programming languages honoured in the name of which notebook project?

Jupyter blends Julia, Python and R into one name. It also nods to Galileo, whose notebooks recorded his discovery of Jupiter's moons.

6

R grew out of S, a statistics language created in the 1970s at which birthplace of Unix?

Bell Labs statisticians began S in the mid-1970s so they could explore data interactively rather than write a fresh program for each analysis. Most S code still runs unaltered in R.

7

R is written in C, R itself and which older language, a number-crunching favourite since the 1950s?

Fortran sits beside C in R's source code, and R users can still link their own compiled routines in either language when a task needs heavy computation.

8

Which two-character symbol is R's traditional assignment operator, pointing from a value toward its name?

<- is typed as a less-than sign and a minus, and it points at the object receiving the value. In most contexts a plain = works as well.

9

R became an official part of which free-software project, started by Richard Stallman, in 1997?

GNU adopted R with version 0.60, earning the language the nickname "GNU S". R is distributed under the project's General Public License.

10

R reached the milestone of version 1.0.0 in the year 2000 on which quirky calendar date?

Leap day, 29 February 2000, brought R's first full release, six and a half years after it was first posted online in August 1993.

11

Who co-created R with Robert Gentleman, their shared first initial giving the language its name?

Ross Ihaka did not stop at one language: by 2010 he was working on a new statistical language based on Lisp.

12

Which archive, launched in 1997 with just three mirror sites, is the main place to download R packages?

CRAN stands for the Comprehensive R Archive Network. Its founders modelled the name and scope on earlier archives for TeX and Perl software.

13

RStudio, the company behind the popular R editor, renamed itself what in 2022 to signal a move beyond R?

Posit replaced the RStudio name because that brand made it harder to win over Python users. Its commercial products were rebranded to match, such as Posit Workbench.

14

Who created the ggplot2 plotting package and later co-wrote the book R for Data Science?

Hadley Wickham won the 2019 COPSS Presidents' Award for work credited with making statistical thinking and computing accessible to a large audience.

15

The R plotting package ggplot2 draws both its design and its double-g name from which Leland Wilkinson book?

Grammar of Graphics argues that any chart can be described as a set of independent parts, such as scales and layers. That is why ggplot2 users build a plot piece by piece.

16

Which collection of R packages, including dplyr, readr and purrr, loads with a single command?

Tidyverse packages are built around tidy data, where every variable is a column and every observation a row, so one package's output feeds straight into the next.

17

Which R package, announced by RStudio's Joe Cheng in 2012, turns an analysis into an interactive web app?

Shiny caught on as a tool for fast prototyping, and since 2022 the same framework has also been available for Python.

18

Which character begins a comment in R, just as it does in Python and Unix shell scripts?

# hides the rest of its line from R, unless the mark sits inside a quoted string, where it is treated as ordinary text.

19

Which R function, usually seen at the top of a script, loads an installed package into the current session?

library is the standard call, as in library(ggplot2). Its cousin require does the same job but returns FALSE with a warning, rather than an error, when the package is missing.

20

Which R structure holds a table whose columns can each be a different type, much like a spreadsheet?

Data frame columns can mix numbers, text and logical values, as long as every column has the same number of rows. Rows and columns can still be picked out with matrix-style indexing.

21

Which constant marks a missing value in R, and spreads to the result of nearly any arithmetic it touches?

NA stands for "not available". Since the real value is unknown, even the test x == NA comes back as missing, which is why R supplies is.na() instead.

22

R builds vectors with c(), as in c(1, 2, 3); which word does that c stand for in R's documentation?

Combine is the word in the function's official title, "Combine Values into a Vector or List". It accepts any number of vectors and joins them end to end.

23

In R, unlike Python, what does a negative index such as x[-1] return for a vector x?

All but the first element comes back, because a minus sign tells R which positions to leave out. Python would hand back the final item instead.

24

Which R data type stores categorical values, such as blood groups, as a fixed set of levels?

Factor variables are stored as integer codes with the level names attached as labels, which is why as.numeric() on one returns the codes rather than the original values.

25

Which operator gives the remainder of a division in R, the job a lone % sign does in Python and C?

The %% operator is R's modulo, so 7 %% 2 gives 1. Its sibling %/% performs integer division, turning 7 %/% 2 into 3.

26

Which R function previews the top of a table, returning just six rows unless told otherwise?

head has a mirror image, tail, which returns the last six rows instead. Either one takes a second argument to change the count.

27

In R, which single character typed before a function's name opens its help page, a shortcut for help()?

A ? before a name, as in ?mean, opens the matching help page. Doubling the mark searches all installed documentation when only a vague topic is known.

28

Which R function joins pieces of text into one string, putting a space between them by default?

paste inserts a single space unless its sep argument says otherwise, while its sibling paste0 glues the pieces together with nothing in between.

29

Which R function makes random results repeatable, so sample() returns the same numbers on every run?

set.seed fixes the starting point of R's random number generator. Without it, R builds a fresh seed from the clock and the process ID, so every session differs.

30

Which verb from R's dplyr package keeps only the rows of a table that meet a condition, such as age > 30?

filter works on rows, while select picks columns. A row whose condition comes out as missing is treated like FALSE and dropped.

31

Which R function compactly displays what is inside an object, showing each column's type and first few values?

str is short for structure. It works on any R object, even deeply nested lists, and aims to show just one line for each basic component.

32

What does R call repeating a shorter vector's values until they match a longer one in arithmetic?

Recycling repeats the shorter vector as often as needed, so c(1, 2, 3, 4) + c(10, 20) gives 11, 22, 13, 24. A single number is simply reused for every position.

33

Which term does R's documentation use for silently converting c(1, "a", TRUE) into three character strings?

Coercion follows a fixed order in which the most flexible type wins: character beats double, which beats integer, which beats logical. It is also why TRUE + TRUE equals 2.

34

Which R function works like lapply but tries to return a vector or matrix instead of a list?

sapply is a wrapper around lapply that simplifies the result when it can. Because its return type depends on the data, R also offers vapply, which fixes the type in advance.

35

Which symbol is R's built-in pipe operator, added to the base language in version 4.1.0?

The |> pipe passes the value on its left into the function call on its right, so x |> f(y) means f(x, y). Unlike the older package-based pipe, it needs nothing extra attached.

36

Which creator of S coined the R maxim that everything that exists is an object?

John Chambers paired the line with a second slogan: everything that happens is a function call. He went on to become a core member of the R project itself.

37

Papers that cite R credit the R Foundation for Statistical Computing, based in which European capital?

Vienna is part of the official citation for R, so the Austrian capital turns up in reference lists wherever the software was used. The main R download site is hosted at a university there too.

38

R's lexical scoping, a key way it differs from S, was borrowed from which dialect of Lisp?

Scheme gave R functions that look up free variables in the environment where they were created. In S, those values came from a set of global variables instead.

39

Which of R's object-oriented systems is the oldest and simplest, with no formal class definitions?

S3 is informal enough that giving an object a class just means setting an attribute. It is the only object system used in R's own base and stats packages.

40

What is the term for R's practice of delaying work on a function argument until the code actually uses it?

Lazy evaluation means an argument that is never used is never computed, so a function can be handed a faulty input and still run. Each waiting argument is stored as a "promise".

Think you know R Programming?

Put these facts to the test with the interactive quiz.

Take the 40-question quiz

Teaching R Programming?

Make a custom quiz — handy for classrooms and study groups.

Make a quiz on anything

Related quizzes