library(ggplot2)
ggplot(ncbirths, aes(x = habit, y = weight)) +
geom_boxplot() +
labs(x = "Smoking status of mother", y = "Birth weight of baby (in lbs)")
ggplot(ncbirths, aes(x = whitemom, y = visits)) +
geom_boxplot() +
labs(x = "Mother's race", y = "Number of doctor visits during pregnancy")
ggplot(ncbirths, aes(x = mature, y = gained)) +
geom_boxplot() +
labs(x = "Mother's age category", y = "Weight gained during pregnancy")
Run the code above in your browser using DataLab