Re: [R] merging two maxtrices

2010-09-05 Thread Dennis Murphy
j[as.numeric(rownames(k)), ] - k j [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] NA NA NA NA NA NA NA NA NANA [2,]16 11 16 21 26 31 36 4146 [3,] NA NA NA NA NA NA NA NA NANA [4,]27 12 17 22

Re: [R] merging two maxtrices

2010-09-05 Thread Bill.Venables
Is this all you want? j - matrix(nrow=10,ncol=10) k - matrix(seq(1:50), ncol=10) row.names(k) - seq(2,10,by=2) row.names(j) - 1:10 j[row.names(k), ] - k j [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] 1NA NA NA NA NA NA NA NA NANA 2 16 11 16

Re: [R] merging two maxtrices

2010-09-05 Thread steven mosher
weird, I tried that but it didnt appear to work.. hmm. Thanks I try it again On Sun, Sep 5, 2010 at 12:21 AM, bill.venab...@csiro.au wrote: Is this all you want? j - matrix(nrow=10,ncol=10) k - matrix(seq(1:50), ncol=10) row.names(k) - seq(2,10,by=2) row.names(j) - 1:10

Re: [R] merging two maxtrices

2010-09-05 Thread steven mosher
ya, unfortunately k was actually a dataframe and not a matrix when it was returned from the function, which explains why I got unexpected results On Sun, Sep 5, 2010 at 12:21 AM, bill.venab...@csiro.au wrote: Is this all you want? j - matrix(nrow=10,ncol=10) k - matrix(seq(1:50), ncol=10)