[R] newbie question: ROW average

Peter Dalgaard p.dalgaard at biostat.ku.dk
Mon May 29 15:12:51 CEST 2006


A Ezhil <ezhil02 at yahoo.com> writes:

> When I tried with (assuming 'M' is my old matrix): 
> 
> dim(M) <- c(4,248,74)
> mn <- apply(M, c(2,3), mean)
> 
> the following error occured:
> Error: dim<- : dims [product 73408] do not match the
> length of object [74]

In that case, M clearly wasn't a 992x74 matrix!

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list