river_net ObjectCalculates the potamodromous and diadromous forms of the Dendritic
Connectivity Index (DCI) for a river_net object.
calculate_dci(
net,
form,
pass = NULL,
weight = NULL,
threshold = NULL,
parallel = FALSE,
quiet = FALSE
)An sf object of the river network with new columns specifying
segmental DCI values and relative DCI values. These are each segment's
contribution to the global DCI score which is printed. The relative values
are simply those values normalized.
A river_net object.
A string specifying the DCI form to calculate. Options are: "pot" for potamodromous or "dia" for diadromous.
The name of a column in the nodes table of net containing
numeric passability values. If NULL, all barriers are assumed to have 0
passability.
The name of a column in the edges table of net containing
numeric weights for river lengths. If NULL, DCI is calculated using river
length only.
Optional numeric value specifying a dispersal limit in map
units. If NULL (default), no limit is applied.
Logical. If FALSE, the default, all operations are
performed in series. If TRUE parallel operation is performed using
furrr::future_pmap(). Specify the number of workers and strategy using
future::plan().
Logical. If FALSE, prints the global DCI and a plot of river
segments to the console. Defaults to TRUE.
Passability values are probabilities between 0 and 1, where 0 indicates a fully impassable barrier and 1 indicates full passability. If values in the specified passability column fall outside this range, they will be normalized.
Weighting values should also be probabilities between 0 and 1. River segments
with weights of 0 or NA will be excluded from the DCI calculation.
Upon successful calculation, the global DCI value for the river network will
be printed to the console unless quiet = TRUE.
# For the potamodromous DCI
res <- calculate_dci(net = yamaska_net, form = "pot", pass = "pass_1",
weight = "weight")
Run the code above in your browser using DataLab