Skip to content

Commit 062125b

Browse files
authored
Merge pull request cmu-delphi#6 from dajmcdon/km/remove-gginnards
Replaced all instances of gginnards.
2 parents 0b16591 + c5f09ef commit 062125b

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Imports:
3737
Suggests:
3838
covidcast,
3939
delphi.epidata,
40-
gginnards,
4140
ggplot2,
4241
knitr,
4342
outbreaks,

vignettes/advanced.Rmd

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,18 +367,16 @@ fc <- bind_rows(k_week_ahead(x, ahead = 7, as_of = TRUE),
367367
k_week_ahead(x, ahead = 28, as_of = FALSE))
368368
369369
# Plot them, on top of latest COVID-19 case rates
370-
p <- ggplot(fc, aes(x = target_date, group = time_value, fill = as_of)) +
370+
ggplot(fc, aes(x = target_date, group = time_value, fill = as_of)) +
371371
geom_ribbon(aes(ymin = fc_lower, ymax = fc_upper), alpha = 0.4) +
372+
geom_line(data = x_latest, aes(x = time_value, y = case_rate),
373+
inherit.aes = FALSE, color = "gray50") +
372374
geom_line(aes(y = fc_point)) + geom_point(aes(y = fc_point), size = 0.5) +
373375
geom_vline(aes(xintercept = time_value), linetype = 2, alpha = 0.5) +
374376
facet_grid(vars(geo_value), vars(as_of), scales = "free") +
375377
scale_x_date(minor_breaks = "month", date_labels = "%b %y") +
376378
labs(x = "Date", y = "Reported COVID-19 case rates") +
377-
theme(legend.position = "none")
378-
379-
gginnards::append_layers(
380-
p, geom_line(data = x_latest, aes(x = time_value, y = case_rate),
381-
inherit.aes = FALSE, color = "gray50"), pos = "bottom")
379+
theme(legend.position = "none")
382380
```
383381

384382
We can see that these forecasts, which come from training an ARX model jointly

vignettes/archive.Rmd

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,19 +175,17 @@ snapshots <- map_dfr(versions, function(v) {
175175
bind_rows(x_latest %>% mutate(version = self_max)) %>%
176176
mutate(latest = version == self_max)
177177
178-
p <- ggplot(snapshots %>% filter(!latest),
178+
ggplot(snapshots %>% filter(!latest),
179179
aes(x = time_value, y = percent_cli)) +
180180
geom_line(aes(color = factor(version))) +
181181
geom_vline(aes(color = factor(version), xintercept = version), lty = 2) +
182182
facet_wrap(~ geo_value, scales = "free_y", ncol = 1) +
183183
scale_x_date(minor_breaks = "month", date_labels = "%b %y") +
184184
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),
189187
aes(x = time_value, y = percent_cli),
190-
inherit.aes = FALSE, color = "black"), pos = "top")
188+
inherit.aes = FALSE, color = "black")
191189
```
192190

193191
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),
377375
k_week_ahead(x, ahead = 28, as_of = FALSE))
378376
379377
# 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)) +
381379
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") +
382382
geom_line(aes(y = fc_point)) + geom_point(aes(y = fc_point), size = 0.5) +
383383
geom_vline(aes(xintercept = time_value), linetype = 2, alpha = 0.5) +
384384
facet_grid(vars(geo_value), vars(as_of), scales = "free") +
385385
scale_x_date(minor_breaks = "month", date_labels = "%b %y") +
386386
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")
392388
```
393389

394390
Each row displays the forecasts for a different location (CA and FL), and each

0 commit comments

Comments
 (0)