[R] Histogram for factors
tov at ece.cmu.edu
Tue Jan 16 07:47:43 CET 2001
Robert Gentleman <rgentlem at jimmy.harvard.edu> writes:
> On Sat, Jan 13, 2001 at 10:31:16AM +0100, Martin Maechler wrote:
> > >>>>> "PD" == Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> writes:
> > Well,
> > plot(f)
> > already draws a barplot of a factor f (by the plot.factor method).
> Which many of us would think of as being the right "default" plot
> for a factor. However, I also think that the right thing for histogram
> to do is to inform you that this is not a continuous variable.
> I don't think of a barplot (barchart) as a specialized histogram.
thanks for the responses. Yepp, I fell into the trap of trying to use
histogram for a definitely not continuous variable. I'll go back to
reading a couple of my intro books...
Now the (actually not so) funny thing is that the labels for the
x-axis disappear when I specify colors for the bars. (R 1.2.1, Linux)
Ok, maybe the other thing I'll have to catch up on is the docu...
x <- cut (rnorm (10), 3)
plot (x) # has x axis (i.e. cut ranges in this silly example)
plot (x, col="green") # no x axis. Dto. for col=c("green", "red") etc.
mailto:tov at ece.cmu.edu (Tom Vogels) Tel: (412) 268-6638 FAX: -3204
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