Created
June 3, 2017 06:45
-
-
Save shv38339/ea3e396f6ca75f3334d6738d168cae41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ggplot(${1:data = }, aes(${2:x = )}) + | |
geom_histogram(aes(y = ..density..), ${3:binwidth = }, colour = "black", fill = "white") + | |
geom_density(alpha = .2, fill = "#FF6666") + | |
geom_vline(aes(xintercept = mean(${4:}), color = "mean"), linetype = "dashed", size = 2) + | |
geom_vline(aes(xintercept = median(${5:}), color = "median"), linetype = "dashed", size = 2) + | |
scale_color_manual(name = "Dispersion", values = c(median = "blue", mean = "red")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an R snippet. Therefore, the following formatted pieces of code, ${#:...}, need to be replaced with actual values.