Skip to content

Instantly share code, notes, and snippets.

@aammd
Created April 13, 2016 22:56
Show Gist options
  • Save aammd/4361c22aefb70e9573090f42de897218 to your computer and use it in GitHub Desktop.
Save aammd/4361c22aefb70e9573090f42de897218 to your computer and use it in GitHub Desktop.
nudging that stat_summary()
library(dplyr)
library(tidyr)
library(ggplot2)
df <- data_frame(x = rnorm(n = 20, mean = 4),
y = rnorm(n = 20, mean = 7)) %>%
gather(XY, numbers)
ggplot(df, aes(x = XY, y = numbers)) +
geom_point(position = position_jitter(width = 0.05)) +
stat_summary(fun.data = "mean_cl_boot",
colour = "red", size = 2,
position = position_nudge(x = c(-0.1, 0.1)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment