From 0a2488485c75bfcadc90f75711b0884c4bb15baa Mon Sep 17 00:00:00 2001 From: pratikunterwegs Date: Wed, 31 Jan 2024 09:49:07 +0000 Subject: [PATCH] Update Readme.Rmd with `` class --- README.Rmd | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.Rmd b/README.Rmd index bb44dac1..5e17aa0d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -152,10 +152,20 @@ output <- model_default_cpp( ) ``` +_epidemics_ models return output of the `` class, which encapsulates the model function name, model data (under "data"), and model parameters (such as infection parameters) and composable elements (such as interventions) under "parameters", as well as the package version used to run the model (under "hash"). + +```{r} +# visualise the object +output + +# get data from model run +data <- get_parameter(output, "data") +``` + Visualise the development of individuals in the "infectious" compartment over model time. Note that these curves represent the number of individuals that are infectious, and not the number of newly infectious individuals. ```{r fig-modelout, echo=FALSE} -filter(output, compartment == "infectious") %>% +filter(data, compartment == "infectious") %>% ggplot() + geom_vline( xintercept = c(close_schools[["time_begin"]], close_schools[["time_end"]]),