contract_nodes | R Documentation |
Combine groups of nodes into a single node per group. The centroid such a group will be used by default as new geometry of the contracted node. If edges are spatially explicit, edge geometries are updated accordingly such that the valid spatial network structure is preserved.
contract_nodes(
x,
groups,
simplify = TRUE,
compute_centroids = TRUE,
reconnect_edges = TRUE,
attribute_summary = "ignore",
store_original_ids = FALSE,
store_original_data = FALSE
)
x |
An object of class |
groups |
A group index for each node in x. |
simplify |
Should the network be simplified after contraction? Defaults
to |
compute_centroids |
Should the new geometry of each contracted group of
nodes be the centroid of all group members? Defaults to |
reconnect_edges |
Should the geometries of the edges be updated such
they match the new node geometries? Defaults to |
attribute_summary |
How should the attributes of contracted nodes be
summarized? There are several options, see
|
store_original_ids |
For each group of contracted nodes, should
the indices of the original nodes be stored as an attribute of the new edge,
in a column named |
store_original_data |
For each group of contracted nodes, should
the data of the original nodes be stored as an attribute of the new edge, in
a column named |
The contracted network as object of class sfnetwork
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.