nb | R Documentation |
Neighbor lists are sparse adjacency matrices in list format that specify for
each node to which other nodes it is adjacent. They occur for example in the
sf package as sgbp
objects, and are also
frequently used in the spdep package.
nb_to_sfnetwork(
x,
nodes,
directed = TRUE,
edges_as_lines = TRUE,
compute_length = FALSE,
force = FALSE
)
sfnetwork_to_nb(x, direction = "out")
x |
For the conversion to sfnetwork: a neighbor list, which is a list
adjacent to. For the conversion from sfnetwork: an object of class
|
nodes |
The nodes themselves as an object of class |
directed |
Should the constructed network be directed? Defaults to
|
edges_as_lines |
Should the created edges be spatially explicit, i.e.
have |
compute_length |
Should the geographic length of the edges be stored in
a column named |
force |
Should validity checks be skipped? Defaults to |
direction |
The direction that defines if two nodes are neighbors.
Defaults to |
For the conversion to sfnetwork: An object of class
sfnetwork
. For the conversion from sfnetwork: a neighbor list,
which is a list with one element per node that holds the integer indices of
the nodes it is adjacent to.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.