calcMeanConnectivityMatrices: Calculate a set of mean connectivity matrices

View source: R/calcMeanConnectivityMatrices.R

calcMeanConnectivityMatricesR Documentation

Calculate a set of mean connectivity matrices

Description

Function to calculate a set of mean connectivity matrices (as a dataframe).

Usage

calcMeanConnectivityMatrices(tbl_conns, tbl_stanzas)

Arguments

tbl_conns

- dataframe with connectivity information from which to extract stanza means by startZone **x** endZone

tbl_stanzas

- tibble::tibble with stanza definitions

Details

Mean, median, and std deviation of the connFrac column of the input tbl_conns are calculated by startZone **x** endZone across each stanza defined in tbl_stanzas.

tbl_stanzas must be a tibble with columns "stanza" and "years". For each row, stanza must be a unique label identifying the stanza in question and years must be a 1-element list containing a vector containing the years over which the stanza is defined.

Value

a dataframe with mean, median, and std dev. of connectivity values by stanza

Examples

## Not run: 
#--assume tbl_conns is the result of rbind'ing several connectivity matrices.

## End(Not run)
## Not run: 
#--a 1-stanza example
tbl_stanzas = tibble::tibble(stanza="stanza 1",years=list(2005:2020));
tbl_mn = calcMeanConnectivityMatrices(tbl_conns,tbl_stanzas);

## End(Not run)

## Not run: 
#--a 2-stanza example (using \code{\link[tibble]{tribble}} to define stanzas)
tbl_stanzas = tibble::tribble(~stanza,    ~years,
                              "stanza 1",2005:2020,
                              "stanza 2",2015:2030
                              );
tbl_mn = calcMeanConnectivityMatrices(tbl_conns,tbl_stanzas);

## End(Not run)


wStockhausen/rDisMELS documentation built on March 27, 2022, 1 a.m.