我正在尝试用ggplot2创建几个出版品质的数字。
我必须创建一个饼图,饼图条或条形图条。有没有办法用R / ggplot2生成这样的图表?
这个问题与上一个问题有所不同" Is it possible to create a pie in pie chart in SPSS or R?"在以下方面:
实施例
一张饼图:
一块饼图:
数据示例
这是一个包含数据的表格,以及在Excel中制作的这些数据的饼图。
图表:
+-----------------------+-------------------------------------+ | Class | Taxonomic composition (class level) | +-----------------------+-------------------------------------+ | Unassigned - other | 1.1% | +-----------------------+-------------------------------------+ | Bacteria - other | 0.1% | +-----------------------+-------------------------------------+ | Coriobacteriia | 0.4% | +-----------------------+-------------------------------------+ | Bacteroidia | 35.9% | +-----------------------+-------------------------------------+ | Deferribacteres | 1.3% | +-----------------------+-------------------------------------+ | Bacilli | 4.3% | +-----------------------+-------------------------------------+ | Clostridia | 51.1% | +-----------------------+-------------------------------------+ | Erysipelotrichi | 4.4% | +-----------------------+-------------------------------------+ | Deltaproteobacteria | 0.4% | +-----------------------+-------------------------------------+ | Epsilonproteobacteria | 0.5% | +-----------------------+-------------------------------------+ | TM7-3 | 0.1% | +-----------------------+-------------------------------------+ | Mollicutes | 0.2% | +-----------------------+-------------------------------------+ | Verrucomicrobiae | 0.2% | +-----------------------+-------------------------------------+