Description Usage Arguments Value Note Examples
display synchronized death and confirmed case series
1 2 3 4 5 6 7 8 9 10 |
dfr |
data.frame with columns 'date', 'deaths', 'confirmed', where the latter are 'incident', formed by differencing the cumulative counts provided in sars2pack |
basedate |
minimum date to consider |
maxdate |
maximum date to use, Inf for no limit relative to available dates |
shift |
number of days to backshift death counts, coerced to integer |
winsize |
size of running window for averaging incident counts for plotting |
na_pad |
logical(1) passed to runner::mean_run |
xlim.in |
defaults to NULL, standard graphics::plot xlim, or can be a numeric(2) |
yspan |
log-scale extra padding for y extent, expanding range of log(incident cases)+log cIFR |
a list with elements x, y, date, invisibly
The 'IFR' is crudely estimated as exp(mean(log(deaths)-log(confirmed))).
1 2 3 4 5 6 7 8 9 10 11 12 | if (!exists("jh")) jh = enriched_jhu_data()
requireNamespace("dplyr")
us = dplyr::filter(jh, alpha2Code=="US")
usd = dplyr::filter(us, subset=="deaths")
usc = dplyr::filter(us, subset=="confirmed")
usd2 = usd[-1,]
usd2$inc = diff(usd$count)
usc2 = usc[-1,]
usc2$inc = diff(usc$count)
uss = rbind(usd2, usc2)
uscd = data.frame(date=usc2$date, confirmed=usc2$inc, deaths=usd2$inc)
plot_sync(uscd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.