Skip to content
R for the Rest of Us Logo

R in 3 Months (Spring 2026)

Quiz

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

1.

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!

You need to be signed-in to comment on this post. Login.

Course Content

144 Lessons