@@ -175,19 +175,17 @@ snapshots <- map_dfr(versions, function(v) {
175
175
bind_rows(x_latest %>% mutate(version = self_max)) %>%
176
176
mutate(latest = version == self_max)
177
177
178
- p <- ggplot(snapshots %>% filter(!latest),
178
+ ggplot(snapshots %>% filter(!latest),
179
179
aes(x = time_value, y = percent_cli)) +
180
180
geom_line(aes(color = factor(version))) +
181
181
geom_vline(aes(color = factor(version), xintercept = version), lty = 2) +
182
182
facet_wrap(~ geo_value, scales = "free_y", ncol = 1) +
183
183
scale_x_date(minor_breaks = "month", date_labels = "%b %y") +
184
184
labs(x = "Date", y = "% of doctor's visits with CLI") +
185
- theme(legend.position = "none")
186
-
187
- gginnards::append_layers(
188
- p, geom_line(data = snapshots %>% filter(latest),
185
+ theme(legend.position = "none") +
186
+ geom_line(data = snapshots %>% filter(latest),
189
187
aes(x = time_value, y = percent_cli),
190
- inherit.aes = FALSE, color = "black"), pos = "top")
188
+ inherit.aes = FALSE, color = "black")
191
189
```
192
190
193
191
We can see some interesting and highly nontrivial revision behavior: at some
@@ -377,18 +375,16 @@ fc <- bind_rows(k_week_ahead(x, ahead = 7, as_of = TRUE),
377
375
k_week_ahead(x, ahead = 28, as_of = FALSE))
378
376
379
377
# Plot them, on top of latest COVID-19 case rates
380
- p <- ggplot(fc, aes(x = target_date, group = time_value, fill = as_of)) +
378
+ ggplot(fc, aes(x = target_date, group = time_value, fill = as_of)) +
381
379
geom_ribbon(aes(ymin = fc_lower, ymax = fc_upper), alpha = 0.4) +
380
+ geom_line(data = x_latest, aes(x = time_value, y = case_rate),
381
+ inherit.aes = FALSE, color = "gray50") +
382
382
geom_line(aes(y = fc_point)) + geom_point(aes(y = fc_point), size = 0.5) +
383
383
geom_vline(aes(xintercept = time_value), linetype = 2, alpha = 0.5) +
384
384
facet_grid(vars(geo_value), vars(as_of), scales = "free") +
385
385
scale_x_date(minor_breaks = "month", date_labels = "%b %y") +
386
386
labs(x = "Date", y = "Reported COVID-19 case rates") +
387
- theme(legend.position = "none")
388
-
389
- gginnards::append_layers(
390
- p, geom_line(data = x_latest, aes(x = time_value, y = case_rate),
391
- inherit.aes = FALSE, color = "gray50"), pos = "bottom")
387
+ theme(legend.position = "none")
392
388
```
393
389
394
390
Each row displays the forecasts for a different location (CA and FL), and each
0 commit comments