R | Programming Quiz | Question 22

Last Updated :
Discuss
Comments

What does the following R code do?

df <- data.frame(name = c("Alice", "Bob", "Charlie"),
                age = c(25, 30, 22))
 

Creates a matrix with two columns: "name" and "age"

Creates a data frame with two columns: "name" and "age"

Creates a list with two elements: "name" and "age"

Raises an error due to incorrect syntax

Share your thoughts in the comments