View source: R/matrix_to_predictions.R
matrix_to_predictions | R Documentation |
This function is the opposite of predictions_to_matrix()
. It
converts a wide matrix into a long data frame. It is mostly used within
plotting functions.
matrix_to_predictions(contact_matrix)
contact_matrix |
square matrix with age group to and from information in the row and column names. |
data.frame with columns age_group_to
, age_group_from
, and
contacts
.
fairfield <- abs_age_lga("Fairfield (C)")
# We can convert the predictions into a matrix
fairfield_school_contacts <- predict_contacts(
model = polymod_setting_models$school,
population = fairfield,
age_breaks = c(0, 5, 10, 15, Inf)
)
fairfield_school_contacts
fairfield_school_mat <- predictions_to_matrix(fairfield_school_contacts)
fairfield_school_mat
matrix_to_predictions(fairfield_school_mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.