Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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

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: c
Explanation: This behavior is used to access entire rows or columns of a matrix.

Join The Discussion