Midterm
Congratulations; we are about two-thirds through the course! We will now review what you've learned so far by checking your understanding! This is an optional assignment provided to gauge how well you've absorbed material we've covered thus far.
Question 1
In the following code block, fill in the missing code to show that the datatype of the first element of Petal.Length is of datatype numeric.
Question 2
Fill in the mutate
and summarise
functions
to show the mean of the
Sepal.Width_2
column is 5.05733.
Question 3
In the following group_by
and summarise
code,
what will the dimensions be in the returned dataframe? Try to answer
this before running the code.
Question 4
Use %in%
to subset the iris dataframe to only
rows that contain versicolor and virginica, what are
the dimensions of this dataframe after the filter?
Question 5
Use mutate
, filter
and summarise
to: create a variable that is twice the value of Petal.Length,
filter this new column to values that are less than 10, and then
find the sum of all of these values.