Skip to content
Prev 157483 / 398506 Next

histogram-like plot with two variables

On 28/09/2008 10:02 PM, J?rg Gro? wrote:
You could use barplot():

barplot(y,names=x)

You could also do it with plot.histogram, but it's trickier, because 
it's designed for continuous data.  For example,

dat <- hist(x, plot=FALSE, breaks=c(-1,x)+0.5)
dat$density <- y
plot(dat, freq=FALSE)

Duncan Murdoch