Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Use geom_boxplot(),
mapping a continuous variable to y and a discrete variable to x (Figure 6-15):
library(MASS)# For the data setggplot(birthwt,aes(x=factor(race),y=bwt))+geom_boxplot()# Use factor() to convert numeric variable to discrete