Vidyalelo
R Programming · Q6

Data Structures in R Programming

Programming · R Programming · question 6

Q6

In R, how is a matrix initialized with values 1 to 9 arranged in three rows?

A.
matrix(1:9, nrow = 3, ncol = 3)
Answer
B.
matrix(c(1, 2, 3, 4, 5, 6, 7, 8, 9), 3, 3)
C.
matrix(1:9, rows = 3, cols = 3)
D.
mat(1:9, 3, 3)

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board