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
Predict what will show in the console if you run the code below:
a <- c(1, 2, NA, 4, "cat1989dog", 5)
my_function <- function(x) {
x <- na.omit(x)
}
my_function(a)
To have x transferred out to the global environment and available to use in other operations, you must either store the result of the function to an object when running it (e.g., my_result ← my_function(my_data) or make the function return the local object (e.g., using return(x)).
To have x transferred out to the global environment and available to use in other operations, you must either store the result of the function to an object when running it (e.g., my_result ← my_function(my_data) or make the function return the local object (e.g., using return(x)).
The third element of a is a NA value.
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.