@@ -30,6 +30,8 @@ library(epidatr)
3030library(epiprocess)
3131library(data.table)
3232library(dplyr)
33+ library(purrr)
34+ library(ggplot2)
3335
3436dv <- covidcast(
3537 data_source = "doctor-visits",
@@ -48,6 +50,8 @@ library(epidatr)
4850library(epiprocess)
4951library(data.table)
5052library(dplyr)
53+ library(purrr)
54+ library(ggplot2)
5155```
5256
5357## Getting data into ` epi_archive ` format
@@ -189,8 +193,6 @@ marked by dotted vertical lines, and draw the latest curve in black (from the
189193latest snapshot ` x_latest ` that the archive can provide).
190194
191195``` {r, fig.width = 8, fig.height = 7}
192- library(purrr)
193- library(ggplot2)
194196theme_set(theme_bw())
195197
196198self_max = max(x$DT$version)
@@ -203,15 +205,15 @@ snapshots <- map_dfr(versions, function(v) {
203205
204206ggplot(snapshots %>% filter(!latest),
205207 aes(x = time_value, y = percent_cli)) +
206- geom_line(aes(color = factor(version))) +
208+ geom_line(aes(color = factor(version)), na.rm=TRUE ) +
207209 geom_vline(aes(color = factor(version), xintercept = version), lty = 2) +
208210 facet_wrap(~ geo_value, scales = "free_y", ncol = 1) +
209211 scale_x_date(minor_breaks = "month", date_labels = "%b %y") +
210212 labs(x = "Date", y = "% of doctor's visits with CLI") +
211213 theme(legend.position = "none") +
212214 geom_line(data = snapshots %>% filter(latest),
213215 aes(x = time_value, y = percent_cli),
214- inherit.aes = FALSE, color = "black")
216+ inherit.aes = FALSE, color = "black", na.rm=TRUE )
215217```
216218
217219We can see some interesting and highly nontrivial revision behavior: at some
0 commit comments