Reads multiple Demetra+ workspaces and extracts comparable series (by SAI and series type), returning them in a tidy format. This is particularly useful to compare results across different specifications (e.g. RSA3 vs RSA5).

compare(..., series_names)

Arguments

...

character Workspace file paths.

series_names

character Vector of SAI names to compare.

Value

A data.frame with columns:

  • ws: workspace name (derived from file basename),

  • SAI: SAI name,

  • series: type of series,

  • date: observation date,

  • value: numeric value.

Examples

if (FALSE) { # \dontrun{
# Two demo workspaces (RSA3 and RSA5)
path1 <- file.path(tempdir(), "workspace_RSA3.xml")
path2 <- file.path(tempdir(), "workspace_RSA5.xml")

df <- compare(path1, path2, series_names = "series_1")
head(df)

# In a Shiny app, you can filter and plot:
library(ggplot2)
ggplot(df, aes(x = date, y = value, color = ws, linetype = series)) +
  geom_line() +
  geom_point()
} # }