create_age_mask: Create age mask

View source: R/helpers.R

create_age_maskR Documentation

Create age mask

Description

Converts a data frame of individual ages to give the index of the first infection that individual could have had

Usage

create_age_mask(DOBs, possible_exposure_times)

Arguments

DOBs

the vector of dates of birth, same time units as possible_exposure_times

possible_exposure_times

the vector of times that individuals can be infected

Value

a vector giving the first index of possible_exposure_times that an individual can be infected

Examples

data(example_antibody_data)
data(example_antigenic_map)
times <- example_antigenic_map$inf_times
DOBs <- unique(example_antibody_data[,c("individual","birth")])
age_mask <- create_age_mask(DOBs$birth, times)

adamkucharski/serosolver documentation built on April 13, 2024, 10:24 a.m.