Identify connected components of graph and add corresponding component
column to data.frame.
Arguments
- graph
A
data.frameof edges- strong
Defaults to
FALSE', which may identify components which can only be accessed from a single direction, and therefore not actually used in routing calculations. IfTRUE, all edges in each identified component are fully connected in both directions. Edges which connect different strong components belong to neither, and are given a component value ofNA`.
Value
Equivalent graph with additional component column, sequentially
numbered from 1 = largest component (by number of edges for the default,
or by number of vertices for strong = TRUE).
See also
Other modification:
dodgr_contract_graph(),
dodgr_uncontract_graph()
Examples
graph <- weight_streetnet (hampi)
graph <- dodgr_components (graph)
#> graph already has a component column