RE: “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.

 

Kiran Patil Asked on September 28, 2017 in R.
Add Comment
2 Answers

The command matrix[,5]  will extract The fifth column of the matrix as a vector.

Answered on October 1, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.