calculate_dci: Calculate DCI for a 'river_net' Object

View source: R/calculate_dci.R

calculate_dciR Documentation

Calculate DCI for a river_net Object

Description

Calculates the potamodromous and diadromous forms of the Dendritic Connectivity Index (DCI) for a river_net object.

Usage

calculate_dci(
  net,
  form,
  pass = NULL,
  weight = NULL,
  threshold = NULL,
  parallel = FALSE,
  quiet = FALSE
)

Arguments

net

A river_net object.

form

A string specifying the DCI form to calculate. Options are: "pot" for potamodromous or "dia" for diadromous.

pass

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.

weight

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.

threshold

Optional numeric value specifying a dispersal limit in map units. If NULL (default), no limit is applied.

parallel

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().

quiet

Logical. If FALSE, prints the global DCI and a plot of river segments to the console. Defaults to TRUE.

Details

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.

Value

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.

Examples

# For the potamodromous DCI
res <- calculate_dci(net = yamaska_net, form = "pot", pass = "pass_1",
weight = "weight")

dci documentation built on June 14, 2025, 1:08 a.m.