outliers_tools.RdThese functions allow extracting, exporting and importing outliers detected in a Demetra+ workspace:
retrieve_outliers() extracts outliers from a .xml workspace.
export_outliers() saves extracted outliers into a YAML file.
import_outliers() loads outliers back from a YAML file.
They are useful for archiving and reusing regression outliers detected during seasonal adjustment workflows.
retrieve_outliers(ws_path)
export_outliers(x, ws_name, path, verbose = TRUE)
import_outliers(x, ws_name, path, verbose)[character] Path to a Demetra+ workspace file
(usually with extension .xml).
list A list of outliers, as returned by
retrieve_outliers().
[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/outliers_<ws_name>.yaml".
[logical] Whether to print informative
messages (default: TRUE).
retrieve_outliers() returns a named list where each element
corresponds to a series in the workspace and contains the names
of detected outliers.
export_outliers() invisibly returns the path of the YAML file
written.
import_outliers() returns a list of outliers read from YAML.
if (FALSE) { # \dontrun{
# Example workflow:
ws_file <- "path/to/workspace.xml"
# 1. Retrieve outliers from a workspace
outliers <- retrieve_outliers(ws_file)
# 2. Export them to a YAML file
export_outliers(outliers, ws_name = "workspace1")
# 3. Import them back later
imported <- import_outliers(x = NULL, ws_name = "workspace1")
} # }