calculate_dci: Calculate different forms of the DCI for a 'river_net' object

View source: R/calculate_dci.R

calculate_dciR Documentation

Calculate different forms of the DCI for a river_net object

Description

Calculate different forms of the DCI for a river_net object

Usage

calculate_dci(
  net,
  form,
  pass = NULL,
  weight = NULL,
  threshold = NULL,
  n.cores = 1,
  quiet = FALSE
)

Arguments

net

A river_net object.

form

A string specifying the form of the DCI to calculate: either "potamodromous", "diadromous", or "invasive".

pass

The name of a column in the nodes table of net which holds the numeric passability of nodes. If none is specified all barriers are automatically considered to have 0 passability.

weight

The name of column in the edges tables of net which holds numeric weights to be applied to river lengths. If none is specified, the DCI is calculated only with river lengths.

threshold

An optional numeric value specifying a dispersal limit in map units. If NULL, the default, no limit is considered.

n.cores

An optional integer value indicating the number of cores to use. Defaults to 1. Currently only works on MacOS and Linux.

quiet

A logical value indicating whether the global DCI and a map of segments should be printed to the console. Defaults to TRUE.

Details

Passability values are probabilities from 0 to 1 where 0 indicates fully impassable and 1 indicates fully passable. If the values in the supplied passability column are not within this range they will be normalized.

Similarly weighting values are probability from 0 to 1. Rivers with weights of either 0 or NA will not be considered when calculating the DCI.

When DCI results are returned succesfully teh global DCI of the given river network will be printed to the console.

Value

A sf object of the rivers from the provided river_net object with new columns specifying the segmental DCI values at each river location. If sites is not NULL, a sf object of the site points with their associated DCI scores.

Examples

## Not run: 
calculate_dci(net = net_name, form = "all", pass = "pass",
  weight = "river_weight", threshold = 1500)
calculate_dci(net = net_name, form = "potamodromous")
calculate_dci(net = net_name, form = "diadromous", threshold = 2100)

## End(Not run)

aarkilanian/dci documentation built on Feb. 5, 2024, 7:12 p.m.