st_as_graph {sfdep} | R Documentation |
Create an sfnetwork
Description
Given an sf
or sfc
object and neighbor and weights lists, create an sfnetwork
object.
Usage
st_as_graph(x, nb, wt)
## S3 method for class 'sf'
st_as_graph(x, nb, wt)
## S3 method for class 'sfc'
st_as_graph(x, nb, wt)
Arguments
x |
object of class |
nb |
a neighbor list. If |
wt |
optional. A weights list as generated by |
Value
an sfnetwork
object
See Also
st_as_nodes()
and st_as_edges()
Examples
if (requireNamespace("dplyr", quietly = TRUE)) {
library(magrittr)
guerry_nb %>%
st_as_graph(nb, wt)
}
[Package sfdep version 0.2.4 Index]