2
事前計算された値のエラーバーをggplotのバープロットに「列単位」でプロットすることはできますか?ggplotエラーバーの事前計算値
このbarplotを生成require(ggplot2)
library("ggplot2")
require(reshape2)
library("reshape2")
df <- structure(list(PVC1 = 0.4019026, PVC2 = 0.4479259, PVC3 = 0.4494118, PVC4 = 0.4729437,
PVC5 = 0.4800556, PVC6 = 0.449229, PVC7 = 0.4905295, PVC8 = 0.4457566,
PVC9 = 0.4271259, PVC10 = 0.4850341, PVC11 = 0.4369965, PVC12 = 0.4064052,
PVC13 = 0.3743776, PVC14 = 0.3603853, PVC15 = 0.3965469, PVC16 = 0.365461),
.Names = c("PVC1","PVC2","PVC3","PVC4","PVC5","PVC6","PVC7","PVC8",
"PVC9","PVC10","PVC11","PVC12","PVC13","PVC14","PVC15","PVC16"),
class = "data.frame",
row.names = c(NA, -1L)
)
melted_df <- melt(df, variable.name = "Locus", value.name = "GC")
st_dev <- c(0.023031363, 0.024919217, 0.017371129,
0.019008759, 0.026650605, 0.026904926,
0.024227542, 0.017767553, 0.026152478,
0.039770898, 0.023929714, 0.028845442,
0.015572219, 0.024967336, 0.014955416, 0.024569096)
gc_chart <- ggplot(melted_df, aes(Locus, GC*100, fill=Locus,)) +
geom_bar(stat = "identity")
gc_chart <- gc_chart + ylab("GC Content (%)")
gc_chart <- gc_chart + theme(axis.text.x = element_text(angle=45, hjust=1))
gc_chart <- gc_chart + geom_abline(intercept=40.8891366,
slope=0,
colour="blue",
linetype="dashed")
gc_chart <- gc_chart + coord_cartesian(ylim=c(0,60))
gc_chart
:
私は彼らに、私の事前計算されたSTの開発者の各値をプロットできるようにしたいのですが、次を考える
プロット内の対応する列。
geom_errorbar
ベクターにこれを行うことができますか?または最初にデータフレームにst dev情報を含める方が簡単でしょうか?
は
完璧!これは仕事です! –