Q. 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"))
πŸ’¬ Discuss
βœ… Correct Answer: (D) vec_named(c(1, 2, 3), c("one", "two", "three"))

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
123
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
81%
Success Rate