Examveda

Which of the following R code extracts the second column for the following matrix?
> x <- matrix(1:6, 2, 3)

A. x[2, ]

B. x[1, 2]

C. x[, 2]

D. x[1 1 2]

Answer: Option C


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

Join The Discussion

Related Questions on Data Structures in R Programming