calcLongTermTrendSimple: calcLongTermTrendSimple

Description Usage Arguments Examples

View source: R/Module_calcLongTermTrendSimple.R

Description

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,

Usage

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
)

Arguments

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

Examples

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)

SOLV-Code/MetricsTest documentation built on Feb. 19, 2021, 10:12 p.m.