我在R (https://github.com/hrbrmstr/waffle)中测试Waffle包,在Microsoft Windows10下使用R版本3.2.2 (32位),当我想要从R脚本绘制Waffle图表时遇到问题。
这是我的R脚本上的代码:
library(waffle)
mm.counts <- c(12, 6, 8, 10, 6, 7)
names(mm.counts) <- c("blue", "brown", "green", "orange", "red", "yellow")
waffle(mm.counts, rows = 7, colors = names(mm.counts), title = "M&M Colors")发布于 2018-10-03 04:59:23
简单的解决方案是显式地在脚本中打印情节
> test.R
library(waffle)
mm.counts <- c(12, 6, 8, 10, 6, 7)
names(mm.counts) <- c("blue", "brown", "green", "orange", "red", "yellow")
wp <- waffle(mm.counts, rows = 7, colors = names(mm.counts), title = "M&M Colors")
print(wp)然后调用脚本
source("test.R")看吧:

https://stackoverflow.com/questions/32823216
复制相似问题