Examveda
Examveda

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

A. matrix(1:9, nrow = 3, ncol = 3)

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


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

Join The Discussion

Related Questions on Data Structures in R Programming