st_as_graph | R Documentation |
Given an sf
or sfc
object and neighbor and weights lists, create an sfnetwork
object.
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)
x |
object of class |
nb |
a neighbor list. If |
wt |
optional. A weights list as generated by |
an sfnetwork
object
st_as_nodes()
and st_as_edges()
if (requireNamespace("dplyr", quietly = TRUE)) {
library(magrittr)
guerry_nb %>%
st_as_graph(nb, wt)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.