[英]How to save a adjacency matrix with “get.adjacency()” in R, with iGraph and RStudio?
是否可以在“get.adjacency()”之后將鄰接矩陣保存為R中的鄰接矩陣? 我試過了
test <- get.adjacency(network)
但是我收到了錯誤
Error in View : cannot coerce class "structure("dgCMatrix", package = "Matrix")" to a data.frame.
我正在使用RStudio和iGraph包。
嘗試在調用get.adjacency(...)
使用sparse=FALSE
g <- graph.full(5)
test <- get.adjacency(g)
class(test)
# [1] "dgCMatrix"
# attr(,"package")
# [1] "Matrix"
test <- get.adjacency(g,sparse=FALSE)
class(test)
# [1] "matrix"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.