[R] How to doulbe all the value on a matrix

Pete Brecknock Peter.Brecknock at bp.com
Mon Jan 17 21:05:07 CET 2011


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
-- 
View this message in context: http://r.789695.n4.nabble.com/How-to-doulbe-all-the-value-on-a-matrix-tp3221213p3221255.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list