compute_indicator: Compute indicator by customized function and variables...

Description Usage Arguments Value See Also

View source: R/indicator-build.R

Description

Use customized function and variable timeseries to compute indicator. Its is a working horse behind create_indicator, modify_indicator.

Usage

1
2
3
4
5
6
7
8
compute_indicator(
  ts_compute_vars,
  compute_fun,
  ...,
  date_index_field = c("date"),
  key_fields = NULL,
  parallel = getOption("zstmodelr.common.parallel", TRUE)
)

Arguments

ts_compute_vars

A dataframe of variable timeseries to compute.

compute_fun

A function of computing indicator.

...

Params to compute_fun.

date_index_field

Name of date index field of ts_vars, default 'date'.

key_fields

A character vector of key fields, which identify unique observation in each date. Default NULL means to not divide data into groups.

parallel

A logic to determine whether to use parallel processing. Default TRUE means to use parallel processing.

Value

A dataframe of result timeseries if succeed, otherwise NULL.

See Also

Other indicator build functions: create_indicator(), modify_indicator()


chriszheng2016/zstmodelr documentation built on June 13, 2021, 8:59 p.m.