R Programming
0Loading crowd target
0Loading crowd target
6correct to beat the crowd
40 free R Programming trivia questions with answers — science & nature quiz, new questions added Oct 2026.
R began as a teaching tool for a university statistics course and grew into one of the most widely used languages for data analysis, charts and research. Its quirks are part of the appeal: its own way of writing assignment, a habit of working on whole vectors at once, and a community with a long-running in-joke tucked into every release. This quiz covers the ground a learner meets early and an interviewer likes to probe: basic syntax and operators, vectors and other data types, handy built-in functions, popular packages for plotting and data wrangling, and the people and history behind the language. It suits students checking their basics, analysts brushing up before an interview, and anyone curious about how R works. Every answer comes with a short explanation, so a wrong guess still teaches something.
30 of 40 questions with answers and explanations. Play the quiz
Q 01R was created in the early 1990s to teach statistics at a university in which Southern Hemisphere country?
New Zealand
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.
Q 02The R package that popularised the %>% pipe puns on the name of which surrealist painter of a famous pipe?
René Magritte
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.
Q 03R releases carry codenames such as "Great Pumpkin" and "Masked Marvel", all nods to which comic strip?
Peanuts
Peanuts has supplied every R codename since Great Pumpkin, the first of them, which was released on Halloween 2011.
Q 04A classic built-in R dataset records fuel economy for 32 cars from a 1974 issue of which magazine?
Motor Trend
Motor Trend is the "mt" in mtcars. Each car is listed with eleven measurements, including miles per gallon, horsepower, weight and quarter-mile time.
Q 05R is one of three programming languages honoured in the name of which notebook project?
Jupyter
Jupyter blends Julia, Python and R into one name. It also nods to Galileo, whose notebooks recorded his discovery of Jupiter's moons.
Q 06R grew out of S, a statistics language created in the 1970s at which birthplace of Unix?
Bell Labs
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.
Q 07R is written in C, R itself and which older language, a number-crunching favourite since the 1950s?
Fortran
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.
Q 08Which 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.
Q 09R became an official part of which free-software project, started by Richard Stallman, in 1997?
GNU
GNU adopted R with version 0.60, earning the language the nickname "GNU S". R is distributed under the project's General Public License.
Q 10R reached the milestone of version 1.0.0 in the year 2000 on which quirky calendar date?
Leap day
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.
Q 11Who co-created R with Robert Gentleman, their shared first initial giving the language its name?
Ross Ihaka
Ross Ihaka did not stop at one language: by 2010 he was working on a new statistical language based on Lisp.
Q 12Which archive, launched in 1997 with just three mirror sites, is the main place to download R packages?
CRAN
CRAN stands for the Comprehensive R Archive Network. Its founders modelled the name and scope on earlier archives for TeX and Perl software.
Q 13RStudio, the company behind the popular R editor, renamed itself what in 2022 to signal a move beyond R?
Posit
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.
Q 21Which constant marks a missing value in R, and spreads to the result of nearly any arithmetic it touches?
NA
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.
Q 22R builds vectors with c(), as in c(1, 2, 3); which word does that c stand for in R's documentation?
Combine
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.
Q 23In R, unlike Python, what does a negative index such as x[-1] return for a vector x?
All but the first element
Q 14Who created the ggplot2 plotting package and later co-wrote the book R for Data Science?
Hadley Wickham
Hadley Wickham won the 2019 COPSS Presidents' Award for work credited with making statistical thinking and computing accessible to a large audience.
Q 15The R plotting package ggplot2 draws both its design and its double-g name from which Leland Wilkinson book?
Grammar of Graphics
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.
Q 16Which collection of R packages, including dplyr, readr and purrr, loads with a single command?
Tidyverse
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.
Q 17Which R package, announced by RStudio's Joe Cheng in 2012, turns an analysis into an interactive web app?
Shiny
Shiny caught on as a tool for fast prototyping, and since 2022 the same framework has also been available for Python.
Q 18Which 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.
Q 19Which R function, usually seen at the top of a script, loads an installed package into the current session?
library
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.
Q 20Which R structure holds a table whose columns can each be a different type, much like a spreadsheet?
Data frame
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.
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.
Q 24Which R data type stores categorical values, such as blood groups, as a fixed set of levels?
Factor
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.
Q 25Which 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.
Q 26Which R function previews the top of a table, returning just six rows unless told otherwise?
head
head has a mirror image, tail, which returns the last six rows instead. Either one takes a second argument to change the count.
Q 27In 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.
Q 28Which R function joins pieces of text into one string, putting a space between them by default?
paste
paste inserts a single space unless its sep argument says otherwise, while its sibling paste0 glues the pieces together with nothing in between.
Q 29Which R function makes random results repeatable, so sample() returns the same numbers on every run?
set.seed
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.
Q 30Which verb from R's dplyr package keeps only the rows of a table that meet a condition, such as age > 30?
filter
filter works on rows, while select picks columns. A row whose condition comes out as missing is treated like FALSE and dropped.