我正在尝试使用 4 种不同颜色制作数据集的 barplot2(上传时间太长)。问题是,只有 3/4 是彩色的,它跳过了第一条。我在谷歌上搜索过我写的是否正确,但它应该是正确的。我也试过用数字而不是名字来写颜色
col = 3:4:5:6
但我得到了相同的结果,它跳过了第一个小节。
我尝试过的: 在提出问题之前,我已经在 Stackoverflow 上查看过,但我没有找到解决问题的方法,而且我也尝试过 Google。由于我的数据集太长,我只会上传相关代码,我希望你喜欢:)
## Barplot
library(gplots)
CIA <- t.test(tmp3)$conf.int
CIB <- t.test(tmp5)$conf.int
CIC <- t.test(tmp10)$conf.int
CID <- t.test(tmp17)$conf.int
lower <- c(CIA[1], CIB[1], CIC[1], CID[1])
upper <- c(CIA[2], CIB[2], CIC[2], CID[2])
## install.packages( pkgs= "gplots")
barplot2(c(mean3, mean5, mean10, mean17),
plot.ci = TRUE, ci.l = lower, ci.u = upper,
col = c("red", "blue", "yellow", "pink"),
main ="House 3 & 5 overlap", ylim= c(0,6),
names = c("3","5","10","17"))
结果:
编辑:没有na的: