calcPercChange: calcPercChange

View source: R/Module_calcPercChange.R

calcPercChangeR Documentation

calcPercChange

Description

This function applies the calculation of percent change in abundance over time to a data frame (Year x Stock) iteratively for each year of the time-series using only the data prior to that year. It calculate declines over a specified number of generation and uses an exponential model to estimate decline rate, as per IUCN guidelines. For a single vector use calcPercChangeSimple() to calculate percent declines over the entire time period.

Usage

calcPercChange(
  X,
  gen.in = 4,
  slope.num.gen = 3,
  extra.yrs = 0,
  genmean.smoothing = TRUE,
  log.transform = TRUE,
  out.exp = TRUE,
  tracing = FALSE
)

Arguments

X

a data frame of raw values with dimensions Years x Stocks. Row labels are years. NAs values are allowed.

gen.in

= average generation time

slope.num.gen

number of generations over which to calculate the perc change

extra.yrs

to handle COSEWIC "extra year". default is 0

genmean.smoothing

if TRUE, apply the smoothSeries() function. default is TRUE

log.transform

if TRUE, log-transform the time series before calculating the smoothed series. default is TRUE

out.exp

if TRUE, take the exponent of the smoothed series for output. default is TRUE

tracing

if TRUE, print various diagnostics to the command line. default is FALSE


Pacific-salmon-assess/WSP-Metrics-Pkg documentation built on July 16, 2025, 1:46 p.m.