Re: [R] colSums and rowSums with arrays - different classes and dim ?

2005-04-21 Thread Prof Brian Ripley
On Thu, 21 Apr 2005, Ernesto Jardim wrote: I'm using colSums and rowSums to sum the first dimensions of arrays. It works ok but the resulting object is different. See a3d - array(rnorm(120, mean=2), dim=c(20,6,1)) dim(colSums(a3d)) [1] 6 1 dim(rowSums(a3d)) NULL class(colSums(a3d)) [1] matrix

Re: [R] colSums and rowSums with arrays - different classes and dim ?

2005-04-21 Thread Ernesto Jardim
Prof Brian Ripley wrote: On Thu, 21 Apr 2005, Ernesto Jardim wrote: I'm using colSums and rowSums to sum the first dimensions of arrays. It works ok but the resulting object is different. See a3d - array(rnorm(120, mean=2), dim=c(20,6,1)) dim(colSums(a3d)) [1] 6 1 dim(rowSums(a3d)) NULL