给定一个最小的数据集,在其中寻找某个主题在 500 个观察值的数据集中的出现。with_motif 表示具有指定主题的观察,而 without_motif 是没有主题的观察。
with_motif <- 100
without_motif <- 400
dt <- data.frame(with_motif,without_motif)
以下代码将使用 ggplot2 库绘制条形图,
bar_plot <- ggplot(melt(dt),aes(variable,value)) + geom_bar() + scale_x_discrete(name="with or without") + theme_bw() + opts( panel.grid.major = theme_blank(),title = "", plot.title=theme_text(size=14))
bar_plot
我想计算 95% CI 的标准误差并将条形图附加到图上。ggplot 提供geom_errorbar()
,但我很高兴知道得出标准误差(偏差)的不同方法,以便计算误差线限制(CI)。