Re: [R] Sum results in a matrix

2012-03-14 Thread Petr Savicky
On Wed, Mar 14, 2012 at 02:28:22AM -0700, RMSOPS wrote: > thank you > >It is working, a question in the wake of the array. > > with the following code I am creating a data frame to store the data without > repeating the code is working. >The question is the best way to do this process in

Re: [R] Sum results in a matrix

2012-03-14 Thread RMSOPS
thank you It is working, a question in the wake of the array. with the following code I am creating a data frame to store the data without repeating the code is working. The question is the best way to do this process in R tab<-NULL for(i in 1: nrow(res4)) { for(j in i:nrow(res4)) {

Re: [R] Sum results in a matrix

2012-03-13 Thread R. Michael Weylandt
res3 + t(res3) Michael On Tue, Mar 13, 2012 at 8:15 AM, RMSOPS wrote: > Hello, >     With the following code get the results array > res3<-table(df$v_source,df$v_destine) > >  1  2  3  4  5  6  7 >  1  0 10  0  0  0  0  0 >  2 11  0  0  0  0  0  0 >  3  0  0 18 15  0  0  0 >  4  0  0 15 11  0  0

[R] Sum results in a matrix

2012-03-13 Thread RMSOPS
Hello, With the following code get the results array res3<-table(df$v_source,df$v_destine) 1 2 3 4 5 6 7 1 0 10 0 0 0 0 0 2 11 0 0 0 0 0 0 3 0 0 18 15 0 0 0 4 0 0 15 11 0 0 0 5 0 0 0 0 1 0 0 6 0 0 0 0 0 1 0 7 0 0 0 0 0 0 18 my