当华夫饼情节中的值<1时,他们不会显示。
library(waffle)
wp<-waffle(c(10,25,25,1,0.05,0.5,30,7.5,0.95),
rows=10,
colors=c("#CC0000", "#006600", "#669999", "#00CCCC",
"#660099", "#CC0066", "#FF9999", "#FF9900", "black"))
是否有办法使用华夫饼干或ggplot以其比例值填充剩余的盒子?例如每个细胞多种颜色?
答案 0 :(得分:0)
这就是重点。正如@camille所说,华夫饼干情节的重点是每个完整的观测结果只有1个元素。
但是,您(或其他想要类似结果的人)可以做的是稍微重塑数据以反映那些属于自己“其他”类别的小观察值:
parts <- c("A" = 10, "B" = 25, "C" = 25, "D" = 1, "G" = 30, "H" = 7.5,
"Others" = 0.95 + 0.05 + 0.5)
waffle(parts,
rows=10,
colors=c("#CC0000", "#006600", "#669999", "#00CCCC",
"#FF9999", "#FF9900", "blue"))