我有数据框
pGi.Fi <- data.frame(
Metadata_Well = c("D01", "F01"),
Freq = c("0.3789279","0.4191564"),
control = c("Scramble2","Scramble2"))
置信区间的向量CI <- c(0.03222640,0.03196117)
此代码用于生成带有 error_bar 的条形图
limits <- aes(ymax = Freq+CI, ymin = Freq-CI)
dodge <- position_dodge(width=0.9)
bp <- ggplot(data=pGi.Fi, aes(x=Metadata_Well, y=Freq, fill=control)) +
geom_bar(position = "dodge", stat="identity") +
geom_bar(position=dodge) +
geom_errorbar(limits, position=dodge, width=0.25) +
scale_fill_grey()
我有这个错误
美学的长度必须为 1,或者与 dataProblems:Metadata_Well, Freq 的长度相同
感谢您的回答