Skip to contents

Generates a theoretical territory area for every reach within the catchment. Reaches must be <1000m but <200m is recomended. Territory sizes (based on length of channel) are randomly generated from a normal distribution using rnorm(1, 1630, 293) where the mean is 1630 with a standard deviation of 293m. This range is based on empiracal studies: Campbell, et al. (2005); Vorel, et al. (2008), John and Kostkan (2009), Graf, et al. (2016); and Mayer, et al. (2017).

Usage

gen_territories(BeaverNetwork, progbar = TRUE, multicore = TRUE, ncores)

Arguments

BeaverNetwork

A river network with attributed results from Graham, et al., (2020) or Macfarlane, et al., (2017) An sf object or an sf-readable file. See sf::st_drivers() for available drivers.

progbar

Boolean to use a progress bar to monitor progress

multicore

Boolean to multiple core - This function can be slow for large catchments so TRUE is recomended.

ncores

numeric denoting the number of processes to run the function across. If not included, defaults to: parallel::detectCores()[1]-2

Value

an 'sf object containing a potential territory area for every reach from the input BeaverNetwork.

Examples


if (FALSE) {
# --- Subset dataset for example to reduce computation time  for example ---
BeavNetOtter <- RivOtter_BeaverNet[RivOtter_BeaverNet$Str_order > 3,]

# ---------- run terriroty generation --------

gen_territories(BeavNetOtter)
}