Quiz
This lesson is called Quiz, part of the R in 3 Months (Spring 2026) course. This lesson is called Quiz, part of the R in 3 Months (Spring 2026) course.
Test your knowledge with the questions below. Answers are not scored and do not affect your certification at the end of the program, so feel free to try as many times as you need. If you have any questions, don't hesitate to use the comments field or to contact Gracielle by email.
Quiz
Which function would you use to keep only certain columns in your data?
filter() is used to keep or remove rows, not columns.
select() is used to choose which columns (variables) to keep in your dataset. For example, select(data, name, age) would keep only the name and age columns. filter() is used to keep or remove rows, not columns.
mutate() creates new columns that are functions of existing variables. It can also modify (if the name is the same as an existing column) and delete columns (by setting their value to NULL).
arrange() orders the rows of a data frame by the values of selected columns.
What does the mutate() function do?
To remove rows that don't meet certain conditions we use the filter() family of functions.
To select specific columns from a dataset we use the select() family of functions.
mutate() creates new columns or modifies existing columns in your dataset. For example, mutate(height_cm = height_m * 100) would create a new column called height_cm based on an existing height_m column.
To sort a dataset in ascending or descending order we can use the arrange() function.
You want to keep only the rows where temperature is above 20 degrees. Which function and syntax would you use?
filter() is used to keep rows that meet certain conditions. The condition goes inside the filter function: filter(data, temperature > 20). Remember: filter() works with rows, select() works with columns.
filter(data, select(temperature > 20))
Have any questions? Put them below and we will help you out!
Course Content
144 Lessons
You need to be signed-in to comment on this post. Login.