affect_outliers.RdThis function updates a Demetra+ workspace (.xml) by inserting
pre-specified outliers into the domainSpec of each seasonal adjustment
model (SAI).
Typically, the list of outliers is created with retrieve_outliers() and
stored/exported with export_outliers().
affect_outliers(outliers, ws_path)Invisibly returns NULL. The workspace file at ws_path is updated on disk
with the new outliers.
For each series in the workspace:
The function looks up the corresponding entry in the outliers list.
If outliers are specified, they are split into type (AO, LS, TC, …)
and date (e.g. "2020-03") using regex patterns.
These outliers are then added into the domainSpec of the model using
rjd3toolkit::add_outlier().
The modified workspace is saved in place (argument replace = TRUE).
retrieve_outliers() to extract outliers from an existing workspace.
export_outliers() / import_outliers() to manage YAML files of outliers.
if (FALSE) { # \dontrun{
# Retrieve outliers from an existing workspace
outs <- retrieve_outliers("workspace.xml")
# Reapply them to another workspace
affect_outliers(outliers = outs, ws_path = "workspace.xml")
} # }