Skip to content

Instantly share code, notes, and snippets.

@timcdlucas
Last active October 4, 2016 15:55
Show Gist options
  • Save timcdlucas/01ac71aa058cd8a888344638dcf5cfda to your computer and use it in GitHub Desktop.
Save timcdlucas/01ac71aa058cd8a888344638dcf5cfda to your computer and use it in GitHub Desktop.
boxplot plus smooth
d <- data.frame(year = rep(2012:2016, each = 30),
y = rnorm(5 * 30))
ggplot(d, aes(y = y)) +
geom_boxplot(aes(x = factor(year))) +
geom_smooth(aes(x = as.numeric(factor(year))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment