如何使用ggplot2创建加权饼图

pdu*_*ois 1 r ggplot2

我有以下数据:

#Celltype   Weight
abTcells    10.65
Bcells  14.87
DendriticCells  22.71
gdTCells    8.6
Macrophages 7.14
Monocytes   6.43
Neutrophils 4.13
NKCells 6.94
StemCells   11.44
StromalCells    7.1
Run Code Online (Sandbox Code Playgroud)

如何使用ggplot创建类似于下面的Excel生成的绘图: 在此输入图像描述

Chr*_*rsh 5

ggplot(df,aes(x=factor(1),y=Weight,fill=Celltype))+
   geom_bar(width=1,stat="identity")+coord_polar(theta="y")
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述