library(tidyverse)
# Create data (could be way easier but it's late)
value1 <- abs(rnorm(6))*2
don <- data.frame(
x=LETTERS[1:24],
val=c( value1, value1+1+rnorm(6, 14,1) ,value1+1+rnorm(6, sd=1) ,value1+1+rnorm(6, 12, 1) ),
grp=rep(c("grp1", "grp2", "grp3", "grp4"), each=6)
) %>%
arrange(val) %>%
mutate(x=factor(x, x))
# With a bit more style
ggplot(don) +
geom_segment( aes(x=x, xend=x, y=0, yend=val), color="grey") +
geom_point( aes(x=x, y=val, color=grp), size=3 ) +
coord_flip()+
#theme_ipsum() +
theme(
legend.position = "none",
panel.border = element_blank(),
panel.spacing = unit(0.1, "lines"),
strip.text.x = element_text(size = 8)
) +
xlab("") +
ylab("Value of Y") +
facet_wrap(~grp, ncol=1, scale="free_y")
Created
November 21, 2018 10:10
-
-
Save SuperJohn/ddfe7891fece3ac14eaf8f1838526deb to your computer and use it in GitHub Desktop.
a reall new cool gist
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment