我会尽力为您提供翻译,以下是需要翻译的内容:
编辑以提供可重现的示例。
样本数据:https://owncloud.cesnet.cz/index.php/s/oopPE2Ut4quSVOK
有了这些数据
> head(df)
Sample_Name E Sentrix_ID Sentrix_ID_full
1 P129C1S1 5.636927 5058818037 5058818037_A
2 P129C1S1 5.794948 5058818037 5058818037_A
3 P129C1S1 5.608488 5058818037 5058818037_A
4 P129C1S1 5.989108 5058818037 5058818037_A
5 P129C1S1 5.570090 5058818037 5058818037_A
6 P129C1S1 5.555401 5058818037 5058818037_A
我正在生成水平箱线图。
library(ggplot2)
library(ggthemes)
df <- read.csv("sample.csv")
df$Sentrix_ID <- as.factor(df$Sentrix_ID)
df$Sentrix_ID_full <- as.factor(df$Sentrix_ID_full)
head(df)
p <- ggplot(data = df,
aes(y = E, x = Sentrix_ID_full, color = Sentrix_ID, label = Sample_Name)) +
geom_boxplot(outlier.shape = NA) +
scale_colour_manual(values = c("5058818037" = "red", "5226121006" = "green")) +
theme_few() +
guides(colour = FALSE) +
labs(x = "Sentrix ID", y = "E", title = "intensity values") +
coord_flip()
p
我想给每个箱线图添加标签:
p <- p + geom_text()
有解决方案吗?谢谢提前
geom_text()
中的label
是什么意思? - pogibasgeom_text
(第二个图)的代码。 - pogibas