【发布时间】:2016-07-21 08:16:19
【问题描述】:
我有一个数据框
1 col = sample ID
2 col = bacteria phyla (out of 7 groups)
3 col = bacteria abundance
4 col = fiber category (out of normal, high, low.)
我想用不同的门组作为填充,纤维类别作为 x 轴(所以 3 个高、低和正常的条形图)与 y 轴上的相对丰度进行对比。
Sample Phyla Abundance FiberCategory
42226 Fusobacteria 0.000007990 Normal
42226 Verrucomicrobia 0.000003990 Normal
42226 Other 0.003485600 Normal
42226 Bacteroidetes 0.403487198 Normal
42226 Firmicutes 0.577910 Normal
42226 Proteobacteria 0.0010 Normal
42226 Actinobacteria 0.0140 Normal
311101 Fusobacteria 0.00 Normal
311101 Verrucomicrobia 0.003 Normal
311101 Other 0.0009 Normal
311101 Proteobacteria 0.000743013 Normal
311101 Bacteroidetes 0.338208944 Normal
311101 Actinobacteria 0.004665200 Normal
311101 Firmicutes 0.654 Normal
4921103 Other 0.000191938 Low
4921103 Fusobacteria 0.000000000 Low
4921103 Actinobacteria 0.000246777 Low
4921103 Proteobacteria 0.007608959 Low
4921103 Verrucomicrobia 0.000004570 Low
4921103 Firmicutes 0.267081313 Low
4921103 Bacteroidetes 0.724866443 Low
我试过ggplot(vg, aes(x = VegetablesCategory, y = Abundance, fill = Phyla)),但它说情节已损坏..
有人可以建议如何解决这个问题吗?
【问题讨论】: