I\'m trying to make a time series boxplot using ggplot2.
I have montly values for many individuals.
I need to make a timeseries boxplot by month
I create a function to create the plot you need.
the function is:
ts_plot_season <- function(x = x) {
season <- cycle(x)
season.factor <- factor(season)
ggplot() +
geom_boxplot(mapping = aes(x = season.factor,
y = x)) +
labs(x = "Periodo", y = "Serie")
}
Fox example:
ts_plot_season(AirPassengers)
I hope this help. I know this question is old, but i couldn't find some god answer on the web. So i think this will help to someone.