SteffenMoritz/imputeTS

plotNA.imputation etc. not working with par()/layout()

bjarkeA opened this issue · 1 comments

Dear Steffen,

Thank you for the package.

Minor thing - it seems that plotNA.imputations() does not work with par()/layout(). When plotting together with non-imputed series (plot()), it seems that R chooses to show either plotNA.imputations() or the standard plot() depending on which one i used as the last line of code.

Best Regards,
Bjarke Ahm

Hello Bjarke,

thank you very much for your bug report!

Actually just 5 minutes ago I submitted the new 3.1 imputeTS version for CRAN (will take about 3 days till it is available for all operating systems)
It is a really big overall update to the plotting functions. (the plots are the same, but now based on ggplot2 - thus look better and are easier to adjust)

The functions are renamed:

plotNA.distribution -> ggplot_na_distribution
plotNA.distributionBar -> ggplot_na_intervals
plotNA.gapsize -> ggplot_na_gapsize
plotNA.imputations -> ggplot_na_imputations

Also take a look at the function parameters - they are a different now.

With the new functions placing the plots in a grid is quite easy, here an example:

library("gridExtra")
library("imputeTS")
plot1 <- ggplot_na_distribution(tsAirgap)
plot2 <- ggplot_na_imputations(tsAirgap, na_mean(tsAirgap), legend = F)
grid.arrange(plot1, plot2, ncol=2)

So I hope this bug is also fixed with the update.