as_network | R Documentation |
Create a network from a collection of line strings.
as_network(edges, flatten = TRUE, clean = TRUE)
edges |
A data frame with the network edges |
flatten |
Whether all intersections between edges should be converted to nodes |
clean |
Whether general cleaning tasks should be run on the generated
network (see |
A spatial network object
edges <- sf::st_sfc(
sf::st_linestring(matrix(c(0, 0, 1, 1), ncol = 2, byrow = TRUE)),
sf::st_linestring(matrix(c(0, 1, 1, 0), ncol = 2, byrow = TRUE))
)
sf::st_crs(edges) <- sf::st_crs("EPSG:4326")
as_network(edges)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.