cjo_tools.RdThese functions allow extracting, exporting, and importing the calendrier jours ouvrés (CJO) regressors used in Demetra+ workspaces:
retrieve_cjo() extracts the CJO specification from a .xml workspace.
export_cjo() saves extracted CJO information into a YAML file.
import_cjo() loads CJO information back from a YAML file.
They are useful for documenting and reusing the regression settings applied in seasonal adjustment workflows.
retrieve_cjo(ws_path)
export_cjo(x, ws_name, path, verbose = TRUE)
import_cjo(x, ws_name, path, verbose = TRUE)[character] Path to a Demetra+ workspace
file (usually with extension .xml).
[list | data.frame] An object containing
the CJO information, typically the output of retrieve_cjo().
[character] The name of the workspace, used to build default YAML filenames.
[character] Path to a YAML file to write to
or read from. If missing, defaults to
"model/cjo_<ws_name>.yaml".
[logical] Whether to print informative
messages (default: TRUE).
retrieve_cjo() returns a data.frame with columns:
series: series names,
regs: CJO regressor specification (REG1, REG2, …, REG6,
with or without _LY),
series_span: currently empty but reserved for series span.
export_cjo() invisibly returns the path of the YAML file written.
import_cjo() returns a list or data structure read from YAML.
if (FALSE) { # \dontrun{
ws_file <- "path/to/workspace.xml"
# 1. Retrieve CJO specification
cjo <- retrieve_cjo(ws_file)
# 2. Export to YAML
export_cjo(cjo, ws_name = "workspace1")
# 3. Import back from YAML
imported <- import_cjo(x = NULL, ws_name = "workspace1")
} # }