Next script
library(ggplot2) dat<-rnorm(80) dat<-data.frame(dat) p<-ggplot(dat, aes(x=dat))+geom_histogram() p<-p+geom_rug(sides="b", colour="blue") p
makes this nice picture:

But many of these blue lines overlap. I would like to add a little shake! I tried using:
p<-p+geom_rug(sides="b", position="jitter", colour="blue")
But I got an error message:
stat_bin: binwidth The default is range / 30. Use "binwidth = x" to configure this. Error: position_jitter requires the following missing aesthetic properties: y
The y coordinate for the histogram is the count that the histogram should automatically do.
How can I get my inconvenience?
source share