ia_cast: Use one vector to fore- or backcast another vector

Description Usage Arguments Value Examples

Description

Use one vector to fore- or backcast another vector

Usage

1
2
ia_cast(target, cast_source, cast_source_metric = "level",
  direction = "forward", base_index = NULL)

Arguments

target

Vector of values to be fore- or backcast.

cast_source

Vector of values or growth rates to be applied to target as a cast. cast_source[1] aligns with target[1]. Must be same length as target

cast_source_metric

'level' to apply calculated from rates from cast_source. 'growth_rate' to use cast_source[1] as is.

direction

Use 'forward' to forecast from base_index or 'backward' to backcast from base_index, preserving original values in opposite direction. Use 'both' to cast in both directions from base_index.

base_index

Optional index to begin cast in target. Otherwise first/last non-NA value will be used

Value

An array of same length as target with backcast values.

Examples

1
2
3
ia_cast(c(10:20, rep(NA, 5)), c(1:16))

ia_cast(c(rep(NA, 5), 10:20), c(1:16), direction = "backward", base_index = 10)

ryantimpe/ipfitr documentation built on May 14, 2019, 8:55 a.m.