[R] sapply and median, possible or not ?

Ptit_Bleu ptit_bleu at yahoo.fr
Fri Nov 7 12:14:46 CET 2008


Unfortunately, I have the same error message.
lapply(rowsplit, function(x)mean(x[,sapply(x, is.numeric)])) works but not
with median.
Strange, isn't it?

Any other idea?

Thanks in advance,
Ptit Bleu.


Henrique Dallazuanna wrote:
> 
> Try this:
> 
> lapply(l, function(x)median(x[,sapply(x, is.numeric)]))
> 
> 
> -- 
> Henrique Dallazuanna
> Curitiba-Paraná-Brasil
> 25° 25' 40" S 49° 16' 22" O
> 
> 	[[alternative HTML version deleted]]
> 
> 
> ______________________________________________
> R-help at 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/sapply-and-median%2C-possible-or-not---tp20378222p20378663.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list