long_to_ts: Transform a long format data.frame of time series to a tslist

View source: R/import_helpers.R

long_to_tsR Documentation

Transform a long format data.frame of time series to a tslist

Description

The data.frame must have three columns "date", "value" and "series" (identifying the time series)

Usage

long_to_ts(
  data,
  keep_last_freq_only = FALSE,
  force_xts = FALSE,
  strip_nas = TRUE
)

Arguments

data

data.frame The data.frame to be transformed

keep_last_freq_only

in case there is a frequency change in a time series, should only the part of the series be returned that has the same frequency as the last observation. This is useful when data start out crappy and then stabilize

force_xts

logical

strip_nas

logical should NAs be stripped (no leading and trailing nas) ?


tstools documentation built on June 7, 2023, 5:13 p.m.