data(pts_pop_simul)
suppressWarnings(mat_geo <- mat_geo_dist(pts_pop_simul,
ID = "ID",
x = "x",
y = "y"))
g <- gen_graph_topo(mat_w = mat_geo,
mat_topo = mat_geo,
topo = "comp")
df <- data.frame(igraph::as_edgelist(g))
df$w <- igraph::E(g)$weight
df_to_pw_mat(df, from = "X1", to = "X2", value = "w")
Run the code above in your browser using DataLab