[R] classes and functions for qqnorm and stem

Uwe Dippel udippel at uniten.edu.my
Thu Apr 15 05:20:59 CEST 2010


Referring to "Using R for Data Analysis and Graphics" by J H Maindonald, 
and available from the R site, I found the example on p.30 non-working:
 > stem(qqnorm(possum$hdlngth))
Error in stem(qqnorm(possum$hdlngth)) : 'x' must be numeric
Since qqnorm(possum$hdlngth) plots, and
 > class(possum$hdlngth)
[1] "numeric"
, the problem must be here:
 > class(qqnorm(possum$hdlngth))
[1] "list"
Does 'stem' require numerical input? The help says so.
But how to render it numeric?:
 > class(as.numeric(qqnorm(possum$hdlngth)))
Error: (list) object cannot be coerced to type 'double'

Can someone please enlighten me about what goes wrong/has changed here?

Uwe



More information about the R-help mailing list