View source: R/indivsInfo_ExtractMaxAge.R
indivsInfo_ExtractMaxAge | R Documentation |
Function to extract age for each individual at end of life or model run.
indivsInfo_ExtractMaxAge(sf_EndByStage)
sf_EndByStage |
- sf dataframe returned by |
The input sf dataframe should be the output of
indivsInfo_ExtractEndByStage
or indivsInfo_ExtractStartEndByStage
.
The end of the model run or death is basically identified by the record
where age==max(age)
for each origID, endID pair. However, a straightforward
application of this approach would "double count"
individuals which changed id's during the course of their lifetime, because the "original"
individual (with id = origID) appears to have died when it metamorphoses (origID stays
the same, but id changes to a new unique value). Consequently, individuals which have
origID=endID are removed if there are any other individuals with the same origID but
different endIDs.
tibble dataframe with columns:
startTime
origID - original (starting) individual ID
endID - individual ID at end
maxAge - ending age(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.