On 29/01/2009, at 8:39 AM, Stephan Kolassa wrote:

Assuming your data are in a data.frame called dataset,

apply(dataset,2,median)

should work. Look at

?apply

Note that apply() works with ***matrices***.  The foregoing code will
work, given that all columns of ``dataset'' are numeric, due to the
fact that apply will *coerce* a data frame to a matrix.

However it should always be remembered that

        DATA FRAMES ARE NOT MATRICES!!!

cheers,

        Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
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