View source: R/Module_calcLongTermTrend.R
calcLongTermTrend | R Documentation |
calcLongTermTrend(
X,
gen.in = 4,
recent.num.gen = 1,
extra.yrs = 0,
min.yrs.used = 20,
avg.type = "geomean",
tracing = FALSE,
recent.excl = FALSE
)
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, \itemmin.yrs.usedminimum number of years used to start the iterative calculations \itemavg.type"mean","geomean", or "median" \itemrecent.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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.