Recap what you’ve learned by answering these 8 questions.
Question 1
What is a .R file?
A a file that helps R to know where in the file system you are working and organise files associated with the project.
B a script file where you can write and save code.
C a file used to store raw data to read into R.
D a configuration file that controls RStudio’s user interface layout.
B
Question 2
What is a .Rproj file?
A a file that helps R to know where in the file system you are working and organise files associated with the project.
B a script file where you can write and save code.
C a file used to store raw data to read into R.
D a configuration file that controls RStudio’s user interface layout.
A
Question 3
Which of the below will install and library load the ggplot2 package?
A Run the code
load.package("ggplot2")
.
B Tick the box by ggplot2 in the Packages tab
C In the Packages tab, click Install and type ggplot2. Then run the codelibrary(gpglot2)
D Run ggplot code and the package is automatically installed and loaded
C
(Note that B will library load the package but this will only work if the package is already installed on the computer.)
Question 4
If your data file is not reading into R what things could you check?
A That you are using the correct function for the type of file, for example read.csv for csv files.
B The name of the file is spelled correctly.
C The file exists in the folder you are directing R to.
D All of the above.
D
Question 5
Why will this code on it’s own not work?
ggplot(data = penguins, mapping = aes(x = body_mass_g, y = flipper_length_mm))
A It also needs a
geom
layer.
B Themapping =
part needs to be removed.
C The function should beggplot2
instead ofggplot
.
D The code is missing atheme()
function which is needed to display the plot.
A
Question 6
Which of these is NOT the name of a geom layer?
A geom_smooth
B geom_point
C geom_aes
D geom_violin
C
Note that aes
is not a geom but stands for aesthetic and
tells R what variables to use.
Question 7
Which of these would you use if you wanted to only work with the Gentoo penguin rows of data?
A
group_by()
Bmutate()
Cselect()
Dfilter()
D
Question 8
What is tidy data?
A Data that has been cleaned of all missing values.
B Data that has no duplicated rows.
C Data where each variables forms a column, each observation forms a row and each cell is a single measurement.
D Data that has been sorted alphabetically.
C