我有一个有2个因素(时间和治疗)的phyloseq对象。我用这段代码做了一个相对丰度图:
p1 <- plot_composition(pseqTSS$Rumen$phyTR.core, average_by = "Treat") +
theme(legend.text = element_text(colour = "black", size = 7)) +
theme(legend.key.size = unit(.3, "cm")) +
guides(fill = guide_legend(ncol = 3))
具有以下输出:
当我将facet_wrap与其他因素一起添加时,
p1 <- p1 + facet_wrap(eval(parse(text = paste0("~","Time"))))
代码输出错误:
Error: At least one layer must contain all faceting variables: `Time`.
* Plot is missing `Time`
* Layer 1 is missing `Time`
是否有可能像第一个图一样将facet_wrap
与其他因素相加?
谢谢!