Take external aggregate data and put it in a format used in this package

# S3 method for icm
fortify_aggregate(data, states = NULL, package_source = NULL)

Arguments

data

output from external source package. See details

states

names of states we want aggregate totals of at each time

package_source

optional argument to include the package from which the output is derived from, which helps with the fortify function when outputs are of generic classes such as list or data.frame

Value

a data frame with the following columns

t

time

Xk

columns X0, ..., X_K. which are numeric

Details

This function converts external data sources (we currently support output from the EpiModel and pomp R packages), which is already aggregated and puts it in a format that can be used by our exploring functions.

Examples

## For icm out <- fortify_aggregate(EpiModel_icm)
#> New names: #> * sim -> sim...1 #> * sim -> sim...3 #> * sim -> sim...5
head(out)
#> # A tibble: 6 x 6 #> t orig_t sim X0 X1 X2 #> <int> <int> <fct> <int> <int> <int> #> 1 1 1 sim1 900 100 0 #> 2 1 1 sim2 900 100 0 #> 3 1 1 sim3 900 100 0 #> 4 1 1 sim4 900 100 0 #> 5 1 1 sim5 900 100 0 #> 6 1 1 sim6 900 100 0