| graph_to_df | R Documentation |
The function converts a graph into a edge list data.frame
graph_to_df(graph, weight = TRUE)
graph |
A graph object of class |
weight |
Logical. If TRUE (default), then the column 'link' of the output data.frame contains the weights of the links. If FALSE, it contains only 0 and 1. |
The 'graph' nodes must have names. Links must have weights if 'weight = TRUE'.
An object of class data.frame with a link ID, the origin nodes
('from') and arrival nodes ('to') and the link
value ('link')(weighted or binary)
P. Savary
data(pts_pop_ex)
suppressWarnings(mat_geo <- mat_geo_dist(pts_pop_ex,
ID = "ID",
x = "x",
y = "y"))
g1 <- gen_graph_thr(mat_w = mat_geo,
mat_thr = mat_geo,
thr = 20000)
g1_df <- graph_to_df(g1,
weight = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.