Re: [R] Matrix sum

2009-05-21 Thread daniele riggi
Ok, I know this waybut if i have a lot of matrix, does a function exist to sum all of them elements by elements? 2009/5/21 Jorge Ivan Velez > > Dear Daniele, > Try this: > > A <- matrix(1:10,ncol=2) > B <- matrix(10:20,ncol=2) > A+B > #[,1] [,2] > #[1,] 11 21 > #[2,] 13 23 > #[3,] 15

Re: [R] Matrix sum

2009-05-21 Thread Jorge Ivan Velez
For this, you might want to take a look at the first example in ?Reduce. HTH, Jorge On Thu, May 21, 2009 at 11:21 AM, daniele riggi wrote: > Ok, I know this waybut if i have a lot of matrix, does a function exist to > sum all of them elements by elements? > > > 2009/5/21 Jorge Ivan Velez > > >

Re: [R] Matrix sum

2009-05-21 Thread Uwe Ligges
daniele riggi wrote: Someone knows the existence of a function to sum the elements of the same place A[i,j] B[i,j] of a matrix?thank you Yes: + Uwe Ligges __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] Matrix sum

2009-05-21 Thread Jorge Ivan Velez
Dear Daniele, Try this: A <- matrix(1:10,ncol=2) B <- matrix(10:20,ncol=2) A+B #[,1] [,2] #[1,] 11 21 #[2,] 13 23 #[3,] 15 25 #[4,] 17 27 #[5,] 19 29 HTH, Jorge On Thu, May 21, 2009 at 11:11 AM, daniele riggi wrote: > Someone knows the existence of a function to sum the el

[R] Matrix sum

2009-05-21 Thread daniele riggi
Someone knows the existence of a function to sum the elements of the same place A[i,j] B[i,j] of a matrix?thank you -- Dr. Daniele Riggi, PhD student University of Milano-Bicocca Department of Statistics Building U7, Via Bicocca degli Arcimboldi, 8 20126 Milano, Italy cell. +39 328 3380690 mailt