graph_from_data_frame(d, directed=TRUE, vertices=NULL)
-
directed: whether or not to create a directed graph;
mygraph <- graph_from_data_frame(connect, vertices = coauth, directed = FALSE )
mygraph <- graph_from_data_frame(connect, vertices = coauth, directed = TRUE )
所以,directed=TRUE就是只记录from➡️to的数据(directed);
-
d中from和to两列symbolic edge list都会出现在vertices中;
# Create a graph object with igraph
mygraph <- graph_from_data_frame( connect, vertices = coauth, directed = FALSE )
# Find community
com <- walktrap.community(mygraph)
print(com)
plot(
com,
mygraph,
col = membership(com),
mark.groups = communities(com),
edge.color = c("black", "red")[crossing(com, mygraph) + 1]
)
-
data in string
-
-
data in cluster_walktrap
-