Skip to contents

Transform Time Series List to Data Frame

Usage

tsl_to_df(tsl = NULL)

Arguments

tsl

(required, list) Time series list. Default: NULL

Value

data frame

Examples


tsl <- tsl_simulate(
  n = 3,
  rows = 10,
  time_range = c(
    "2010-01-01",
    "2020-01-01"
  )
)

df <- tsl_to_df(
  tsl = tsl
)

names(df)
#> [1] "name" "time" "a"    "b"    "c"    "d"    "e"   
nrow(df)
#> [1] 30
head(df)
#>   name       time         a         b         c         d          e
#> 1    A 2011-01-10 0.4567578 0.8438665 0.5549751 0.2605360 0.09540473
#> 2    A 2011-07-16 0.5518568 0.7242469 0.4290758 0.3346983 0.45265080
#> 3    A 2012-04-22 0.7082593 0.8696346 0.4929685 0.4349255 0.62071815
#> 4    A 2013-01-28 0.7105106 0.5372702 0.3450217 0.4523439 0.26869769
#> 5    A 2014-05-11 0.6899930 0.4756761 0.4047447 0.5268385 0.11956761
#> 6    A 2015-05-21 0.6093574 0.4675206 0.3626851 0.4716171 0.31333461