【发布时间】:2018-07-02 12:41:13
【问题描述】:
样本数据
set.seed(123)
par(mfrow = c(1,2))
dat <- data.frame(years = rep(1980:2014, each = 8), x = sample(1000:2000, 35*8 ,replace = T))
boxplot(dat$x ~ dat$year, ylim = c(500, 4000))
我有另一个数据集,在某些选定的年份里只有一个值
ref.dat <- data.frame(years = c(1991:1995, 2001:2008), x = sample(1000:2000, 13, replace = T))
plot(ref.dat$years, ref.dat$x, type = "b")
如何在箱线图顶部添加线图
【问题讨论】:
标签: r line scatter-plot boxplot