Description Usage Arguments Examples
View source: R/Module_calcLongTermTrendSimple.R
this function just does a basic long-term trend calculation on a single vector. calcLongTermTrend() applies the same basic calc retrospectively to a data frame of Year x Stock,
1 2 3 4 5 6 7 8 | calcLongTermTrendSimple(
vec.in,
gen.in = 4,
min.lt.yrs = 20,
avg.type = "geomean",
tracing = FALSE,
recent.excl = FALSE
)
|
vec.in |
a vector of values. NA are possible, but will result in NA trend for any recent time window that includes one or more NA |
gen.in |
use the last gen.in values for the "recent" avg |
min.lt.yrs |
return NA if don't have at least this many years to calculate longterm avg |
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 |
1 2 3 4 | calcLongTermTrendSimple(vec.in = as.vector(Nile) ,
gen.in = 4,min.lt.yrs = 20, avg.type = "geomean",
tracing=FALSE,
recent.excl = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.