torchts_parse_formula: Parse time series formula

View source: R/parse-formula.R

torchts_parse_formulaR Documentation

Parse time series formula

Description

First version returns 3 types of variables:

  • outcome

  • predictor

  • index

Usage

torchts_parse_formula(formula, data)

Details

If no predictor is defined, every outcome variable is treated as a predictor

Examples

library(dplyr)
library(torchts)

tarnow_temp <-
  weather_pl %>%
  filter(station == "TARNÓW") %>%
  select(date, max_temp = tmax_daily, min_temp = tmin_daily)

View(torchts_parse_formula(max_temp ~ max_temp +index(date), tarnow_temp))
View(torchts_parse_formula(max_temp ~ date, tarnow_temp))

debugonce(torchts_parse_formula)

# This example is not working
View(torchts_parse_formula(max_temp + min_temp ~ max_temp + min_temp + index(date), tarnow_temp))
View(torchts_parse_formula(max_temp + min_temp ~ max_temp + index(date), tarnow_temp))
View(torchts_parse_formula(min_temp ~ max_temp + date, tarnow_temp))

View(torchts_parse_formula(min_temp ~ max_temp + date + lead(min_temp, 1:5), tarnow_temp))


krzjoa/torchts documentation built on June 24, 2022, 5:30 a.m.