我有下表,需要重现 Excel 中生成的图表。
zz <- "Group_1 57.05% 42.95%
Group_2 33.67% 66.33%
Group_3 11.63% 88.37%
Group_4 50.97% 49.03%
Group_5 0.00% 0.00%
"
Data <- read.table(text=zz, header = FALSE)
Data
V1 V2 V3
1 Group_1 57.05% 42.95%
2 Group_2 33.67% 66.33%
3 Group_3 11.63% 88.37%
4 Group_4 50.97% 49.03%
5 Group_5 0.00% 0.00%
colnames(Data) <- c("Division","InCorrect_Routing","Correct_Routing")
是否可以在 R 中重现下面的堆叠图
zz1 <- "Group_1 0 4 100%
Group_2 29 110 79%
Group_3 0 1 100%
Group_4 17 36 68%
Group_5 6 22 79%
Group_6 14 27 66%
Group_7 252 3417 93%
Group_8 0 3 100%
Group_9 227 523 70%
"
Data1 <- read.table(text=zz1, header = FALSE)
colnames(Data1) <- c("Division","Wrongly_Routed","Correctly_Routed","Routing_Accuracy")
Data1
Division Wrongly_Routed Correctly_Routed Routing_Accuracy
1 Group_1 0 4 100%
2 Group_2 29 110 79%
3 Group_3 0 1 100%
4 Group_4 17 36 68%
5 Group_5 6 22 79%
6 Group_6 14 27 66%
7 Group_7 252 3417 93%
8 Group_8 0 3 100%
9 Group_9 227 523 70%