Created
June 25, 2017 13:58
-
-
Save samclifford/5b3749aa0d6dfa81b31723a4246b6a7f to your computer and use it in GitHub Desktop.
Wheat plot
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
library(tidyverse) | |
tibble(x = rnorm(n=100)) %>% | |
arrange(x) %>% | |
mutate(bin = base::cut(x, breaks=pretty(x,n=20))) %>% | |
group_by(bin) %>% | |
mutate(count = 1:n()) %>% | |
ggplot(data=., aes(x=x, y=count)) + | |
geom_path(aes(group=bin)) + | |
geom_point(size=0.5) + | |
ylim(c(0,NA)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment