Extract a sub-population of individuals involved in an epidemic
extractPop(epidemic, ids = NULL, sampledOnly = TRUE, activeOnly = FALSE, tMin = 0, tMax = Inf, firstN = Inf, lastN = Inf)
epidemic | a list representing an epidemic (as returned by simulateEpidemic) |
---|---|
ids | integer vector or NULL, specifying the id of individuals in epidemic$gen to be extracted |
sampledOnly | a logical indicating whether only recovered individuals should be extracted |
activeOnly | a logical indicating whether only currently infected and alive individuals should be extracted |
tMin, tMax | a numericals indicating the interval of observation times for extracted individuals. If sampledOnly is TRUE the observation time is the time of sampling (recovery), otherwise it is the time of infection. Default: tMin=0, tMax=Inf. |
firstN | integer indicating whether to return only the first firstN observed individuals (default is Inf) |
lastN | integer indicating whether to return only the most recently observed lastN individuals (default is Inf). This filter is applied after the previous filters. |
a data.table representing a subset of epidemic$gen after applying the filters