Graphics Reference
In-Depth Information
Solution
Cleveland dot plots are sometimes used instead of bar graphs because they reduce visual clutter
and are easier to read.
The simplest way to create a dot plot (as shown in Figure 3-27 ) is to use geom_point() :
library(gcookbook) # For the data set
tophit <- tophitters2001[ 1 : 25 , ] # Take the top 25 from the tophitters data set
ggplot(tophit, aes(x = avg, y = name)) + geom_point()
Search WWH ::




Custom Search