Skip to contents

Takes a time series list with multivariate zoo objects to generate a new one with one univariate zoo objects per variable. A time series list with the the zoo objects "A" and "B", each with the columns "a", "b", and "c", becomes a time series list with the zoo objects "A__a", "A__b", "A__c", "B__a", "B__b", and "B__c". The only column of each new zoo object is named "x".

Usage

tsl_burst(tsl = NULL, sep = "__")

Arguments

tsl

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

sep

(required, character string) separator between the time series name and the column name. Default: "__"

Value

time series list: list of univariate zoo objects with a column named "x".

Examples


tsl <- tsl_simulate(
  n = 2,
  time_range = c(
    "2010-01-01",
    "2024-12-31"
  ),
  cols = 3
)

tsl_names_get(tsl)
#>   A   B 
#> "A" "B" 
tsl_colnames_get(tsl)
#> $A
#> [1] "a" "b" "c"
#> 
#> $B
#> [1] "a" "b" "c"
#> 

if(interactive()){
  tsl_plot(tsl)
}

tsl <- tsl_burst(tsl)

tsl_names_get(tsl)
#>   A__a   A__b   A__c   B__a   B__b   B__c 
#> "A__a" "A__b" "A__c" "B__a" "B__b" "B__c" 
tsl_colnames_get(tsl)
#> $A__a
#> [1] "x"
#> 
#> $A__b
#> [1] "x"
#> 
#> $A__c
#> [1] "x"
#> 
#> $B__a
#> [1] "x"
#> 
#> $B__b
#> [1] "x"
#> 
#> $B__c
#> [1] "x"
#> 

if(interactive()){
  tsl_plot(tsl)
}