WorksheetsThe Basics of R
Total questions: 21
Worksheet time: 8mins
What is this an icon of?
slack.png
R Project
R engine
R Studio
What extension will an R script have?
.Rscript
.R
.Rproj
.Rmd
Which command below will create a new object called interviews?
interviews <- c(1,2,3)
interviews[interviews =="yes"]
create.dir(interviews)
interviews <- NULL
What does .Rproj extension denote?
It is the file extension for Rmarkdown document.
It designates an R working directory for R session and makes starting new research projects in R easier.
It is a file that needs to be active for R to work.
It is the file extension for R script.
What is the data type of the 'interviews' object: interviews <- c(1, "a", TRUE, "TRUE")
Logical
Numeric
Character
Complex
Which of the following are good names for your digital objects in R?
My_beautiful_object
My.beautiful.object
My beautiful object
My#Beautif$lobj8ct
MyBeautifulObject
How will R interpret the following statement? 'round()'
As a Subset of an Object called 'round'
As a Vector
As a Function
As a "Plot a Circle" command
How do you install the tidyverse package in R?
install.packages(tidyverse)
install.tidyverse()
library(tidyverse)
install.packages("tidyverse")
What does the following code do: read_csv("data/SAFI_clean.csv")
Creates SAFI_clean.csv spreadsheet in the data folder
Loads SAFI_clean.csv to R Studio with ephemeral output in the console
Deletes the SAFI_clean.csv in the data folder
Creates a new object called SAFI_clean in R Studio environment
If I execute the expression x <- 4 in R, what will be the output of running `class(x)' ?
numeric
-4
"4"
4
What is the class of the object defined by x <- c(4, TRUE)?
numeric
logical
integer
a vector containing values "4", "TRUE"
Suppose I have a vector x <- 1:4 and a vector y <- 2. What is produced by the expression x * y?
a numeric vector with elements 3, 4, 5, 6.
a numeric vector with elements 1,4,2
a numeric vector with elements 1,2,3,4,2
a numeric vector with elements 2, 4, 6, 8.
What is this an icon of?
slack.png
R Project
R engine
R Studio
