Description Usage Arguments Value Functions
This expects graph
to have a lat
and lon
vertex attribute, however you
may pass in alternate numeric vectors to v_lat
and v_lon
.
1 2 3 4 5 6 7 8 | graph_to_sf(graph, v_lat = igraph::vertex_attr(graph, "lat"),
v_lon = igraph::vertex_attr(graph, "lon"))
edges_to_sf(graph, v_lat = igraph::vertex_attr(graph, "lat"),
v_lon = igraph::vertex_attr(graph, "lon"))
nodes_to_sf(graph, v_lat = igraph::vertex_attr(graph, "lat"),
v_lon = igraph::vertex_attr(graph, "lon"))
|
graph |
An |
v_lat |
Numeric. Latitude values for each vertex |
v_lon |
Numeric. Longitude values for each vertex |
A named list with an edges
and a nodes
sfc
object.
edges_to_sf
: Return only the edges as an st_linestring
object
nodes_to_sf
: Return only the nodes as an st_point
object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.