[R] Warning message
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Thu Jul 25 11:49:33 CEST 2002
jimmy melinard <jmelinard at yahoo.fr> writes:
> i'm quite new in R and i don't understand why this
> statement doesn't work:
> > mode(mensuel$VARIANCE.PRIX)
>  "numeric"
> > storage.mode(mensuel$VARIANCE.PRIX)
>  "integer"
> > mean(mensuel$VARIANCE.PRIX)
>  NA
> Warning message:
> argument is not numeric or logical: returning NA in:
It certainly looks odd...
I bet that the variable in question is a factor object, in which case
we have the effect that
It's a complicated issue; I don't think it counts as a bug.
Factors really should not be treated as numeric vectors even if they
are internally stored as integers, so the point is rather that you
shouldn't expect is.numeric(x) and mode(x)=="numeric" to be the same
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help