Skip to contents

Multiple x13_both runs with code input from a data frame

Usage

x13_text_frame(
  text_frame,
  series = NULL,
  id = NULL,
  ...,
  drop = TRUE,
  verbose = FALSE,
  dots2list = TRUE
)

Arguments

text_frame

Data frame where all variables are character and with parameter names as column names. Each cell contains text with R code written as source code in a call to x13_both. The parameter will be omitted when the cell is missing (NA). The exception is the column name, name, which contains the time series names. Without such a column, the names are taken from the row names.

series

A named multiple time series object, given as a character string. When NULL, the series parameter must be included in text_frame.

id

To select specific time series to be processed (name or number).

...

Extra arguments that do not change.

drop

Whether to omit list output when a single time series is specified by id.

verbose

When TRUE, function calls will be printed.

dots2list

A technical parameter. When TRUE and when possible (warning when not), the underlying function, text_frame_apply, will be called via call_list instead of .... The advantage is prettier (unevaluated) printing when verbose = TRUE.

Value

A list of x13_both outputs or output from a single run of x13_both (see drop).

Examples

myseries <- pickmdl_data("myseries")
seriesABC <- cbind(A = myseries, B = myseries + 10, C = myseries + 20)

tf <- data.frame(name = c("A", "B", "C"), automdl.enabled = c("TRUE", "FALSE", "FALSE"),
                 usrdef.outliersDate = c('c("2009-01-01", "2016-01-01")', 'c("2009-01-01")', NA),
                 usrdef.outliersType = c('rep("LS", 2)', '"AO"', NA),
                 usrdef.outliersEnabled = c("TRUE", "TRUE", NA))

outABC <- x13_text_frame(tf, series = "seriesABC", spec = "RSA3", transform.function = "Log", 
                         verbose = TRUE)
#>   ----   id =  A    ----
#> x13_both(automdl.enabled = TRUE, usrdef.outliersDate = c("2009-01-01", 
#>     "2016-01-01"), usrdef.outliersType = rep("LS", 2), usrdef.outliersEnabled = TRUE, 
#>     series = seriesABC[, "A"], spec = "RSA3", transform.function = "Log")
#> 
#>   ----   id =  B    ----
#> x13_both(automdl.enabled = FALSE, usrdef.outliersDate = c("2009-01-01"), 
#>     usrdef.outliersType = "AO", usrdef.outliersEnabled = TRUE, 
#>     series = seriesABC[, "B"], spec = "RSA3", transform.function = "Log")
#> 
#>   ----   id =  C    ----
#> x13_both(automdl.enabled = FALSE, series = seriesABC[, "C"], 
#>     spec = "RSA3", transform.function = "Log")
#> 
outB   <- x13_text_frame(tf, series = "seriesABC", spec = "RSA3", transform.function = "Log", 
                         id = "B")
identical(outABC[[2]], outB)  # TRUE
#> [1] TRUE