Google News
logo
R - Quiz(MCQ)
Which of the following is invalid assignment in R?
A)
> m <- mat(nrow = 2, ncol = 3)
B)
> m <- mat(nrow = 2, ncol = 5)
C)
> m <- matrix(nrow = 2, ncol = 3)
D)
> m <- matrix(nrow = 2, ncol = 3.5)

Correct Answer :   > m <- matrix(nrow = 2, ncol = 3)


Explanation : Matrix Entries can be thought of starting in the “upper left” corner and running down the columns.

Advertisement