Creates infection types from infection compositions

infection_types(nms, perms)

Arguments

nms

Names of the species we are looking at.

perms

List of outputs of moi_perms.

Value

Returns a list of vectors that correspond to the infection types of the infection compostions given within `perms`

Details

For each matrix of moi permutations within `perms`, each row is used to work out the infection type from the infection composition. E.g. if the row of the matrix is [2, 1, 0] and our `nms` are [a, b, c] then the infeciton composition is "a/a/b" but the observed infection type will be "a/b"

Examples

if (FALSE) { perms <- lapply(1:2, moi_perms, n = 3) nms <- c("a", "b", "c") infection_types(nms,perms) #> [[1]] #> [1] "c" "a" "b" #> #> [[2]] #> [1] "c" "a/c" "a" "b/c" "a/b" "b" }