Examveda

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"))

Answer: Option D


This Question Belongs to R Programming >> Data Structures In R Programming

Join The Discussion

Related Questions on Data Structures in R Programming