Skip to contents

These functions allow to extract, export and import the calendar (TD) regressors used in JDemetra+ workspaces:

  • retrieve_td() extracts the TD specification from a .xml workspace.

  • export_td() saves extracted TD information into a YAML file.

  • import_td() loads TD information back from a YAML file.

They are useful for documenting and reusing the regression settings applied in seasonal adjustment workflows.

Usage

export_td(x, ws_name, path = NULL, verbose = TRUE)

import_td(ws_name, path = NULL, verbose = TRUE)

retrieve_td(
  jws,
  domain = TRUE,
  estimation = FALSE,
  point = FALSE,
  verbose = TRUE
)

Arguments

x

[list | data.frame] An object containing the TD information, typically the output of retrieve_td().

ws_name

[character] The name of the workspace, used to build default YAML file names.

path

[character] Path to a YAML file to write to or read from. If missing, defaults to "regression/td_<ws_name>.yaml".

verbose

[logical] Whether to print informative messages (default: TRUE).

jws

A Java Workspace object, as returned by rjd3workspace::jws_open() or rjd3workspace::jws_new().

domain

Boolean indicating if the outliers should be extracted from the domain specification.

estimation

Boolean indicating if the outliers should be extracted from the estimation specification.

point

Boolean indicating if the outliers should be extracted from the point specification.

Value

  • retrieve_td() returns a data.frame with columns:

    • series: series names,

    • regs: TD regressor specification (REG1, REG2, …, REG6, with or without _LY),

  • export_td() invisibly returns the path of the YAML file written.

  • import_td() returns a list or data structure read from YAML.

Examples

if (FALSE) { # \dontrun{
ws_file <- "path/to/workspace.xml"

# 1. Retrieve TD specification
td <- retrieve_td(ws_file)

# 2. Export to YAML
export_td(td, ws_name = "workspace1")

# 3. Import back from YAML
imported <- import_td(x = NULL, ws_name = "workspace1")
} # }