“matrix” is a 10 by 10 matrix defined in R, which implies it has 10 rows and 10 columns, the command matrix[ ,5] will extract ?

Suppose “matrix” is a 10 by 10 matrix defined in R, which implies it has 10 rows and 10 columns, the command matrix[ ,5] will extract

  1. The fifth row of the matrix as a vector.
  2. The fifth column of the matrix as a vector.
  3. The element on the fifth row and the fifth column.
  4. The fifth element when going through the matrix column by column from left to right.

 

Asked on September 28, 2017 in R.
Add Comment