SteffenMoritz/imputeTS

Faceting

Closed this issue · 2 comments

Hi @SteffenMoritz. Thank you for the nice package. Is it possible to facet using ggplot2 facet functions and the plotting functions from imputeTS package? Something like.

ggplot_na_distribution()+
  facet_wrap()/facet_grid()

The package is more dedicated to univariate time series so this doesn't work currently. I would have to make some changes to make this possible. I'll keep this in mind - might still be this enables some nice features / additional plotting options - but don't expect something soon.

If it is just, that you want to plot multiple time series besides each other, this will work:


library("gridExtra")
library("imputeTS")
plot1 <- ggplot_na_distribution(tsAirgap, title = NULL, subtitle = NULL, xlab = NULL)
plot2 <- ggplot_na_distribution(tsAirgap, title = NULL, subtitle = NULL, xlab = NULL , ylab = NULL)
plot3 <- ggplot_na_distribution(tsAirgap, title = NULL, subtitle = NULL)
plot4 <- ggplot_na_distribution(tsAirgap, title = NULL, subtitle = NULL, ylab = NULL)
grid.arrange(plot1, plot2,plot3, plot4, ncol=2)

This is now 4 times the same series... but hope you get what I mean, instead of tsAirgap you would put your time series / variables of a multivariate time series.

Thanks for your response. Looking forward to being able to facet easily in the future.