Examveda

Which of the following code extracts 1st element of the 2nd element?
> x <- list(a = list(10, 12, 14), b = c(3.14, 2.81))

A. x[[c(2, 1)]]

B. x[[c(1, 2)]]

C. x[[c(2, 1,1)]]

D. x[[(2, 2,1)]]

Answer: Option A


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

Join The Discussion

Related Questions on Data Structures in R Programming