View source: R/Module_calcLongTermTrend.R
this function applies a basic long-term trend to a data frame of Year x Stock, with various user options (e.g. log transform, gen avg smoothing, time window to use). For a single vector, use calcLongTermTrendSimple()
1 2 3 4 5 6 7 8 9 10 | calcLongTermTrend(
X,
gen.in = 4,
recent.num.gen = 1,
extra.yrs = 0,
min.lt.yrs = 20,
avg.type = "geomean",
tracing = FALSE,
recent.excl = FALSE
)
|
X |
a data frame with 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" |
avg.type |
"mean","geomean", or "median" |
recent.excl |
if TRUE, then don't use the values from the recent gen as part of the LT avg |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.