testdata <-
data.frame(
id_a = c("X1","X2","X3","X3","X1"),
id_b = c("X8","X7","X1","X8","X7"),
xa = c(2,14,10,10,2),
ya = c(6,10,9,9,6),
xb = c(10,4,2,10,4),
yb = c(4,10,6,4,10),
flow_ab = c(2,1,1,1,1),
flow_ba = c(5,1,1,1,2))
sf_objects <- flowmap_sf(flowdat = testdata,crs=4326)
sf_edges <- sf_objects$edges
sf_nodes <- sf_objects$nodes
Run the code above in your browser using DataLab