## 5.6 Exercices

À partir des données `tips` du package `reshape2`, refaire les graphiques suivants.

``````require(reshape2)
# 1
ggplot(tips, aes(x = total_bill, y = tip)) +
geom_point()
# 2
ggplot(tips, aes(x = sex, y = total_bill)) +
geom_point(alpha = 0.2) +
facet_grid(. ~ smoker, labeller = label_both)
# 3
ggplot(tips, aes(x = sex, y = total_bill)) +
geom_boxplot(varwidth = TRUE) +
facet_grid(. ~ smoker, labeller = label_both)
# 4
ggplot(tips, aes(x = total_bill, y = tip)) +
geom_point() +
aes(color = sex)
# 5
ggplot(tips, aes(x = total_bill, y = tip)) +
geom_point() +
aes(color = sex) +
facet_grid(sex ~ .) +
guides(color = FALSE)
# 6
ggplot(tips, aes(x = cut(total_bill, breaks = c(3, 18, 25, 51)), y = tip)) +
geom_boxplot() +
facet_grid(. ~ sex, labeller = label_both) +
labs(x = "total_bill")
# 7
ggplot(tips, aes(x=total_bill, y=tip)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
aes(shape = smoker) +
facet_grid(smoker ~ sex, labeller = label_both) +
guides(shape = FALSE)``````