Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 转换用于社区检测的频率关联矩阵_R_Igraph_Graph Theory - Fatal编程技术网

R 转换用于社区检测的频率关联矩阵

R 转换用于社区检测的频率关联矩阵,r,igraph,graph-theory,R,Igraph,Graph Theory,我有两个相互排斥的集合a和B,分别包含n和p概念。通过这些,我构建了一个nxp关联矩阵,其中的条目包含描述给定的a和B概念对发生了多少次的计数。这些关系不是直接的 我想用这个矩阵建立一个二部图,并对其进行社区检测。例如: library(igraph) incidence.matrix <- structure(c(10, 1, 1, 0, 8, 8, 0, 0, 0, 0, 29, 0, 1, 0, 7, 69, 3, 7, 0, 22), .Dim = c(5L, 4L), .Dim

我有两个相互排斥的集合a和B,分别包含n和p概念。通过这些,我构建了一个nxp关联矩阵,其中的条目包含描述给定的a和B概念对发生了多少次的计数。这些关系不是直接的

我想用这个矩阵建立一个二部图,并对其进行社区检测。例如:

library(igraph)
incidence.matrix <- structure(c(10, 1, 1, 0, 8, 8, 0, 0, 0, 0, 29, 0, 1, 0, 7, 69, 
3, 7, 0, 22), .Dim = c(5L, 4L), .Dimnames = list(c("A1", "A2", 
"A3", "A4", "A5"), c("B1", "B2", "B3", "B4")))

g <- graph_from_incidence_matrix(incidence.matrix, directed = FALSE, multiple = FALSE, weighted = TRUE)
库(igraph)
关联矩阵