[R] Weird problem with median on a factor

Christoph Bier christoph.bier at web.de
Fri Oct 31 11:36:34 CET 2003


Simon Fear schrieb:
> The last part of my message is what I thought might be the cause -
> maybe your median is not an integer, so what category
> should it be mapped to? What do you get if you slip
> in an `as.numeric` before calculating the median?
> [if still an error, then there is definitely something else
> going wrong to report]

Then everything is ok.

 > as.numeric(fbhint.spss1$V15.SP1) -> tmp.data2
 > median(tmp.data2, na.rm=T)
[1] 2

Christoph
-- 
Christoph Bier, Dipl.Oecotroph., Email: bier at wiz.uni-kassel.de
Universitaet Kassel, FG Oekologische Lebensmittelqualitaet und
Ernaehrungskultur \\ Postfach 12 52 \\ 37202 Witzenhausen
Tel.: +49 (0) 55 42 / 98 -17 21, Fax: -17 13




More information about the R-help mailing list