Graphics Reference
In-Depth Information
hist(mtcars$mpg)
# Specify approximate number of bins with breaks
hist(mtcars$mpg, breaks = 10 )
Figure 2-8. Left: histogram with base graphics; right: with more bins. Notice that because the bins
are narrower, there are fewer items in each bin.
With the ggplot2 package, you can get a similar result using qplot() ( Figure 2-9 ):
qplot(mtcars$mpg)
Search WWH ::




Custom Search