Manage trading-day regressors (TD) from JDemetra+ workspaces
td_tools.RdThese functions allow to extract, export and import the calendar (TD) regressors used in JDemetra+ workspaces:
retrieve_td()extracts the TD specification from a.xmlworkspace.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()orrjd3workspace::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.