Q30
How do you create a named numeric vector with values 1, 2, and 3 named "one", "two", and "three" in R?
A.
named_vector <- c(one = 1, two = 2, three = 3)
B.
create_named_vec(1, 2, 3, names = c("one", "two", "three"))
C.
numeric_vector(c(1, 2, 3), names = c("one", "two", "three"))
D.
vec_named(c(1, 2, 3), c("one", "two", "three"))
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board