我有一个嵌套列表 (tukey_full),其中包含我运行的各种 TukeyHSD 测试的结果,并且希望将列表中每个对象的名称作为副标题包含在图中。我已经成功地使用
lapply(tukey_full, plot)
和
for(i in tukey_full) {
plot(i)
}
但是,我不知道如何在字幕中添加对象的名称,我可以通过使用 names 函数看到,就像
> names(tukey_full)
[1] "protein_6289_03860"
[2] "protein_6289_01870"
[3] "protein_2945_03380_5751_03109"
[4] "protein_6289_01021"
[5] "protein_6289_03009"
我尝试使用
for(i in tukey_full) {
plot(i, sub=(i))
和
for(i in tukey_full) {
plot(i, sub=names(i))
}
打印列表让我为每个条目获得以下之一
$protein_6289_01751
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = .x ~ datos_significativos_unknown$cepas)
$`datos_significativos_unknown$cepas`
diff lwr upr p adj
A-C -5.1771274 -8.357472 -1.9967829 0.0025429
B-C -4.8750794 -8.770190 -0.9799687 0.0150836
A-B 0.3020481 -2.878296 3.4823926 0.9653298
粘贴(打印())让我
[1] "list(`datos_significativos_unknown$cepas` = c(2.00490288888889, 2.62596766666667, 0.621064777777779, 0.714833966082775, 1.04596236971821, -0.669004145028336, 3.294971811695, 4.20597296361513, 1.91113370058389, 0.00358339105839034, 0.00217233503326419, 0.429956321252804))"
但这些似乎不起作用。有任何想法吗?谢谢。