想问一下,这个怎么操作
picWidth <- length(unique(corr$node2))/4 + max(nchar(corr$node1))/20+2
Warning message:
In max(nchar(corr$node1)) : no non-missing arguments to max; returning -Inf
picHeight <- length(unique(corr$node1))/4 + max(nchar(corr$node2))/20
Warning message:
In max(nchar(corr$node2)) : no non-missing arguments to max; returning -Inf
ggsave(
"corr.pdf",
plot = p,
width = picWidth,
height = picHeight,
limitsize = FALSE
)
Error in grid.newpage() : 視窗的位置或大小不能是无限的ggsave(
"corr.tiff",
plot = p,
width = picWidth,
height = picHeight,
limitsize = FALSE
在max(nchar(corr$node2)函数里添加参数:na.rm=T,试一下看看。