【发布时间】:2017-11-06 10:38:15
【问题描述】:
也许有人可以帮助我解决我的问题。
我正在使用 RapidMiner 和 R-Script Operator,并使用以下 R-Script 处理 369 x 258 出现矩阵:
# rm_main is a mandatory function,
# the number of arguments has to be the number of input ports (can be none)
rm_main = function(data)
{
total_occurrence <- colSums(data)
data_matrix <- as.matrix(data)
co_occurrence <- t(data_matrix) %*% data_matrix
library(igraph)
graph <- graph.adjacency(co_occurrence,
weighted = TRUE,
mode="undirected",
diag = FALSE)
tkplot(graph,
vertex.label=names(data),
vertex.size=total_occurrence*1,
edge.width=E(graph)$weight*1,)
dev.copy (tk_postscript, file= '/home/knecht/r-graph.pdf')
dev.off()
}
创建图表后,进程终止并显示错误消息“无法从空设备复制”。
所以我的问题是,如何在 postscript 或 png 等文件中打印图表?
亲切的问候
托比亚斯
【问题讨论】:
标签: r export igraph rapidminer