dear all,
Could anyone explain me the behaviour of median() within by()?
(I am running R.2.7.0)

thanks,
vito

> H<-cbind(rep(0:1,l=20),matrix(rnorm(20*2),20,2))
> by(H[,-1],H[,1],mean)
INDICES: 0
        V1         V2
-0.2101069  0.2954377
---------------------------------------------------------------------------------------------------------------------
INDICES: 1
         V1          V2
-0.23682173 -0.01225147
> by(H[,-1],H[,1],median)
Error in median.default(data[x, , drop = FALSE], ...) : need numeric data
>


--
====================================
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 6626240
fax: 091 485726/485612
http://dssm.unipa.it/vmuggeo

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to