R quick quiz

Find out whether you need a really, really basic R course or if you're okay to do some data processing already.

published on April 2124 responses 0

You're confused about data.frames. Which of the following does not help?

> ?base
> ?data.frame
> library(help="data.frame")
> library(help="base")

Which of the following does NOT assign the value "foo" to the variable f?

> f <- "foo"
> "foo" -> f
> f = "foo"
> f <= "foo"

What is a data.frame?

A data structure with the same number of rows and columns
A data structure with columns of equal length that can contain different data types from each other
A data structure with columns of equal length that must all contain the same data type
A vector of list objects

If you wanted to install R, where would you download it from?

r-project.org
cpan.org
rstudio.com
cran.org

A true/false value in R is held in which data-type?

logical
illogical
binary
raw

> df = data.frame(a=c(1,2,3),b=c(4,5,6))

Which two commands give you the number 4?

Select the two correct answers
> df[1,2]
> df$b[1]
> df[2,1]
> df[2:1]
> df[1:2]

Which of the following does NOT call a function?

> ?help
> ??help
> help
> help()

read.delim() gives you what?

vector
data.frame
factor
character

What is R?

R is a free software environment for statistical computing and graphics
R is a family of operating systems for x86-based computers
R is an esoteric programming language created in 1993 by Urban Müller, and notable for its extreme minimalism
R is an integrated family of products that helps to address the entire analytical process, from planning and data collection to analysis, reporting and deployment.

What is a matrix?

A data structure with the same number of rows and columns
A data structure with columns of equal length that can contain different data types from each other
A data structure with columns of equal length that must all contain the same data type
A vector of list objects

Which of the following is NOT an R data structure?

factor
array
list
character

By default, what will happen when a column containing mostly numbers but some text is read by read.table() ?

The text will get replaced by zeroes
The text will get replaced by NA()
The column will be a factor
The column is illegal and will be removed

Which of the following would you use to read a table in a file called "table.csv"?

> read.table.csv()
> read.csv("table.csv")
> "table.csv"
> table.csv()

Which of the following does not contain numbers?

numeric
integer
raw
character

Which of the following do you use to load a package in R?

> install.packages()
> load()
> library()
> source()

Which of the following is NOT an R data type?

logical
complex
raw
factor

What does this mean?
1:10

A numeric vector containing the numbers 1 to 10
A numeric vector containing the numbers 1 and 10
An integer vector containing the numbers 1 to 10
An integer vector containing the numbers 1 and 10

You're not sure if a function "furbies" is available... which of the following would tell you for sure?

> ?furbies
> exists("furbies")
> furbies
[all of these]

How many data types are there in R?

1
3
6
9

The following code creates what?

> c(a=c(1,2),b=c(3,4))

A data.frame with 2 rows and 2 columns
A numeric vector with named values
A factor vector
A list