AQLT / ggdemetra

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

Removed undefined object `spec` #2

Closed djhurio closed 5 years ago

djhurio commented 5 years ago

Removed undefined object spec from the first example at the README file.

AQLT commented 5 years ago

Indeed it is not clear where the spec argument is defined. It is defined in the previous chunk. My idea was to show that, since the last release, the spec argument is inherited from the previous one defined. Do you think that I should also remove the code spec <- RJDemetra::x13_spec("RSA3", tradingdays.option = "WorkingDays") in the README and only leave a complete example in the vignette (https://aqlt.github.io/ggdemetra/articles/ggdemetra.html)? Or should I put it in a more visible way:

library(ggplot2)
library(ggdemetra)
spec <- RJDemetra::x13_spec("RSA3", tradingdays.option = "WorkingDays")
p_ipi_fr <- ggplot(data = ipi_c_eu_df, mapping = aes(x = date, y = FR)) +
    geom_line() +
    labs(title = "Seasonal adjustment of the French industrial production index",
         x = NULL, y = NULL)
p_sa <- p_ipi_fr +
    geom_sa(component = "y_f", linetype = 2,
            spec = spec) + 
    geom_sa(component = "sa", color = "red") +
    geom_sa(component = "sa_f", color = "red", linetype = 2)
p_sa

? Thanks

djhurio commented 5 years ago

My bad. I did not notice the definition of spec at the previous chunk.

Merging those two chunks could be a good idea. Thanks!

AQLT commented 5 years ago

No problem, thanks for pointing out this lack of clarity. I've update the README files.