You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Earo, great work with sugrrants - been using it lots. As discussed noticed some odd behaviour when using facet_wrap with an incomplete time series. Reproducible example to play around with below.
rm(list=ls())
require(sugrrants)
require(lubridate)
require(dplyr)
require(tidyr)
n_days <- 365
n_groups <- 4
start_date <- dmy("1/1/2010")
bla <- data.frame(Group = rep(LETTERS[1:n_groups], each = 24*n_days),
Date = rep(start_date + days(0:(n_days-1)), each = 24),
Time = rep(1:24, n_groups*n_days),
Value = rnorm(24*n_days*n_groups)) %>%
filter(!(Group == "B" & month(Date) %in% 5:12))
p <- bla %>%
group_by(Group) %>%
frame_calendar(x = Time, y = Value, date = Date,
calendar = "monthly", ncol = 2) %>%
ggplot(aes(x = .Time, y = .Value, group = Date)) +
geom_line() +
facet_wrap(~Group)
prettify(p)
You'll see the plot for Group B has it's time-series stretched to fill all the space, but the plot labels are the same as for all the other groups.
The text was updated successfully, but these errors were encountered:
I think rather than changing the position of plot labels for one plot it would probably be most useful if the incomplete time series was padded with NAs so that it was on the same scale as other time-series.
Hi Earo, great work with sugrrants - been using it lots. As discussed noticed some odd behaviour when using facet_wrap with an incomplete time series. Reproducible example to play around with below.
You'll see the plot for Group B has it's time-series stretched to fill all the space, but the plot labels are the same as for all the other groups.
The text was updated successfully, but these errors were encountered: