library(ggplot2)
data <- ToothGrowth
data$dose <- factor(data$dose,levels = c(0.5, 1, 2),
labels = c("D0.5", "D1", "D2"))
ggplot(data, aes(x=dose, y=len)) +
geom_boxplot()+
theme_bw_nogrid()
Run the code above in your browser using DataLab