Guide 3 - Processing Model Results
CGuideCModelResultsProcess.Rmd
This vignette demonstrates how the output of the dynamic yellow fever model functions (see Worked Example 1 - Single Model Run) can be processed using functions in the YEPaux package.
Data is generated as described in Worked Example 1:
library(YEP)
input_data <- readRDS(file=paste(path.package("YEP"),
"/exdata/input_data_example.Rds",sep=""))
model_data <- Model_Run(1.0e-7, 0.0, input_data$vacc_data[1,,], input_data$pop_data[1,,], c(1990:2000),
NULL, "full", input_data$years_labels[1], 1, 1.0, 1.0, 1, 1, FALSE)
Values can be quickly combined across age categories by running the convert_model_output_combine_by_age() function from YEPaux:
model_data_ages_combined <- YEPaux::convert_model_output_combine_by_age(model_data)
The model output can be converted to a simple data frame with each line giving age, particle number, date and S, E, I, R and V. This allows the data to be processed using functions from the tidyr package
model_data_frame <- YEPaux::convert_model_output_tidy(model_data)
head(model_data_frame)