ImperialCollegeLondon / epidemia

epidemia package
https://imperialcollegelondon.github.io/epidemia/index.html
47 stars 15 forks source link

plot_rt() example doesn't work #47

Closed wwiecek closed 4 years ago

wwiecek commented 4 years ago

Per ?plot_rt:

## load required data
library(epidemia)
data("EuropeCovid")
## setup sampling
args <- EuropeCovid
args$algorithm <- "sampling"
args$sampling_args <- list(
iter=1e3,
control=list(adapt_delta=0.95,max_treedepth=15),
seed=12345)
args$group_subset <- c("Italy")
args$formula <- R(country,date) ~  1 + lockdown
args$prior <- rstanarm::normal(location=0,scale=.5)
args$prior_intercept <- rstanarm::normal(location=0,scale=2)

## run sampling
fit <- do.call("epim", args)

Gives

Error in epim(data = list(country = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,  : 
  argument 9 matches multiple formal arguments

Seems like this is old syntax and rt arg is needed.

jonathanishhorowicz commented 4 years ago

I have updated the plotting examples in plot_rt,plot_obs and plot_infections so am closing this issue.