AQLT / ggdemetra

ggplot2 extension for seasonal and trading day adjustment with RJDemetra
https://aqlt.github.io/ggdemetra/
12 stars 3 forks source link

autoplot is not work for TRAMO-SEATS #3

Closed Oseenix closed 11 months ago

Oseenix commented 11 months ago

Hi

The autoplot function can not plot components for TRAMO-SEATS

myseries <- ipi_c_eu[, "FR"]
mysa <- tramoseats(myseries, spec = "RSAfull")
autoplot(mysa)

An error was given:

Error in jx13.SA_spec(y, tramoseats_spec(x)) : 
  use only with c("SA_spec","X13") class object

which is caused by:

autoplot_rjd <- function(object, 
                         components = c("y", "sa", "trend" = "t", "seasonal" = "s", "irregular" = "i"), 
                         forecast = FALSE, ...) {

......
    data <- ts.union(raw(object), trendcycle(object), 
                     seasonaladj(object), calendaradj(object),                         # Here call calendaradj(object)
                     seasonal(object), irregular(object), calendar(object))     # Here call calendar(object)
......
}

Calling the calendaradj and calendar functions on the TRAMO-SEATS model will produce an error.

AQLT commented 11 months ago

Many thanks! I also corrected the functions calendar() and calendaradj() in your PL #4.