簡體   English   中英

igraph保存圖無法與輸出文件名作為對象一起使用

[英]igraph save plot not working with output filename being an object

我遵循了igraph的保存圖文檔,但是我需要遍歷一系列圖形,但它不起作用:

for (f in flist) {
    df <- read.table(f, header=TRUE, sep='\t', quote='', comment.char='')
    png <- paste0(f, '.png')
    g <- graph_from_data_frame(df, directed = FALSE)
    plot(g, png)
}

我嘗試了plot(g, png)plot(g, file=png)plot(g, save=png)plot.igraph(g, png)plot.igraph(g, file=png)plot.igraph(g, save=png) 它們都不起作用。

Error in if (axes) { : argument is not interpretable as logical

要么

Error in i.parse.plot.params(graph, list(...)) : 
Unknown plot parameters: save
for (f in flist) {
    df <- read.table(f, header=TRUE, sep='\t', quote='', comment.char='')
    png <- paste0(f, '.png')
    g <- graph_from_data_frame(df, directed = FALSE)
    plot(g, png)
    png("/YOUR PATH/XXX.png")
    plot(g)
    dev.off()
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM