On 20 Jan 2003 at 17:46, Hedderik van Rijn wrote:
> x <- matrix(rnorm(60),20)
> x[sample(1:60,10)] <- NA
> apply(x,1,mean,na.rm=T)
or simply
colMeans(x,na.rm=T)
>
> On Monday, January 20, 2003, at 04:27 PM, Truc Truong wrote:
>
> > Hi:
> >
> > How do I find average across three columns such as weight1, weight2,
> > weight3 (20 people, each person has three different measures)? They
> > have NA's also. Thanks
> >
> > Tom, Univ of Pittsburgh, ttrut at yahoo.com
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > http://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >
> >
> --
> http://www.van-rijn.org
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Petr Pikal
Precheza a.s., Nab?.Dr.E.Bene?e 24, 750 62 P?erov
tel: +420581 252 257 ; 724 008 364
petr.pikal at precheza.cz; p.pik at volny.cz
fax +420581 252 561