[R] confused about histograms

Richard A. O'Keefe ok at cs.otago.ac.nz
Fri Jul 18 04:25:55 CEST 2003


Jay Pfaffman <pfaffman at relaxpc.com> wrote:
	I've got a data set with integer codes from 0--3.  I'd like a
	histogram with a single bar for 0, 1, 2 and 3.  I'd like each of the 4
	bars centered over a label.
	
> x <- rbinom(100, 3, 0.5)
> barplot(table(x))

This returns a vector of bar locations, which you can use to place
your labels.




More information about the R-help mailing list