Sunday, June 3, 2012

Simple Histogram

Simple Histogram

library(ggplot2) ## load the package
data(movies)     ## load the data
## build the plot
ggplot(movies,aes(x=rating)) + 
  geom_histogram(aes(y=..density..,fill=..density..))
stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this.

0 comments:

Post a Comment