Re: [R] Creating Sub-Matrix

2009-01-31 Thread Rofizah Mohammad
Many thanks David :-) I think I got that idea :-) On Sat, Jan 31, 2009 at 2:16 PM, David Winsemius wrote: > Several ways, two are shown: > > matrix(1:(4*7), 4,7) > [,1] [,2] [,3] [,4] [,5] [,6] [,7] > [1,]159 13 17 21 25 > [2,]26 10 14 18 22 26 > [3,]

Re: [R] Creating Sub-Matrix

2009-01-31 Thread David Winsemius
Several ways, two are shown: > matrix(1:(4*7), 4,7) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,]159 13 17 21 25 [2,]26 10 14 18 22 26 [3,]37 11 15 19 23 27 [4,]48 12 16 20 24 28 > mtx <- matrix(1:(4*7), 4,7) > mtx[-1,]

Re: [R] Creating Sub-Matrix

2009-01-31 Thread Philipp Pagel
> How do I get sub-matrix? Example, I would like to get matrix of size 3x7 > from the matrix of size 4x7. Meaning that I try to exclude one row of the > original matrix. Just exclude the row by negative indexing - e.g. foo[-2,] You may want to consider reading the "Introduction to R" where all th