R -- 同一图表上的成对点图和箱线图:ggplot2 或其他包中是否有模板?

R -- paired dot plot and box plot on same graph: is there a template in ggplot2 or another package?

我是 R 的新用户,发现了我想用我的数据复制的图表。从情节来看,它看起来好像是用 ggplot2 制作的。我搜索了又搜索,但在 ggplot2 或其他包中找不到模板。只是想知道是否有人看过此模板代码?

在此处查看附件图片和论文:http://ehp.niehs.nih.gov/1205963/

也许这会让您入门:

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))