Skip to content
Prev 247564 / 398503 Next

How to doulbe all the value on a matrix

I believe you want to select a subset of rows and subset of columns of your
original matrix m.

If you had wanted only the first row of m, you could have used m[1,] 

Alternatively, if you had wanted only the second column of m then you could
have used m[,2] 

m[1,2] would give you the element at row 1, column 2.

You are requesting rows 2,7, and 8 and columns 1,4,6 and 7.

The syntax is m[required rows, required columns]

c() allows you to specify multiple rows/columns at the same time.    

HTH

Pete