calcLongTermTrend: calcLongTermTrend

View source: R/Module_calcLongTermTrend.R

calcLongTermTrendR Documentation

calcLongTermTrend

Usage

calcLongTermTrend(
  X,
  gen.in = 4,
  recent.num.gen = 1,
  extra.yrs = 0,
  min.yrs.used = 20,
  avg.type = "geomean",
  tracing = FALSE,
  recent.excl = FALSE
)

Arguments

X

a data frame of raw values of dimensions Years x Stocks. Row labels are years, no missing years allowed, NA are possible, but will result in NA Trend for

extra.yrs

to handle COSEWIC "extra year". Specifically,

\item

min.yrs.usedminimum number of years used to start the iterative calculations

\item

avg.type"mean","geomean", or "median"

\item

recent.exclif TRUE, then don't use the values from the recent gen as part of the LT avg

this function applies a basic long-term trend to a data frame of Year x Stock, iteratively for each year using only data prior to that year, with various user options (e.g. log transform, gen avg smoothing, time window to use). For a single vector, use calcLongTermTrendSimple() trend


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