I am a new R user and found graphs I would like to replicate with my data. From the look of the plot, it looks as though it was made in ggplot2. I've searched and searched and can't find a template within ggplot2 or another package. Just wondering if anyone has seen template code for this?
See attached image and paper here: http://ehp.niehs.nih.gov/1205963/
Perhaps this will get you started:
d <- data.frame(y = rnorm(20, 9, 2),
group = as.factor(rep(c('Post-FAP', 'Post-DEP'), each = 10)),
id = rep(1:10, 2))
ggplot(d, aes(y = y)) +
geom_boxplot(aes(x = rep(c(-3, 3), each = 10), group = group), fill = 'steelblue') +
geom_point(aes(x = rep(c(-1, 1), each = 10)), size = 5) +
geom_line(aes(x = rep(c(-1, 1), each = 10), group = id))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With