bind_spatial | R Documentation |
These functions are the spatially aware versions of tidygraph's
bind_nodes
and bind_edges
that allow you to add rows to the nodes or edges tables in a
sfnetwork
object. As with bind_rows
columns are matched by name and filled with NA
if the column does not
exist in some instances.
bind_spatial_nodes(.data, ...)
bind_spatial_edges(.data, ..., node_key = "name", force = FALSE)
.data |
An object of class |
... |
One or more objects of class |
node_key |
The name of the column in the nodes table that character
represented |
force |
Should network validity checks be skipped? Defaults to
|
An object of class sfnetwork
with added nodes or
edges.
library(sf, quietly = TRUE)
library(dplyr, quietly = TRUE)
net = roxel |>
slice(c(1:2)) |>
st_transform(3035) |>
as_sfnetwork()
pts = roxel |>
slice(c(3:4)) |>
st_transform(3035) |>
st_centroid()
bind_spatial_nodes(net, pts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.