Helper function to "borrow" missing age groups from other years
fix_age_group.Rd
Helper function to "borrow" missing age groups from other years
Arguments
- x
DATRASraw object
- age
age to impute
- n
at least this many individuals in each year
- fun
A function such as 'mean','median','min', or 'max'.
Details
In years where there are less than 'n' individuals of age 'age', add fake individuals of that age such that there are 'n'. The length of the individuals are set to the mean (or whatever 'fun' specifies) of all other individuals of the same age. For the minimum and maximum age groups fun it is reasonable to replace 'mean' with 'min' and 'max' respectively. Note, that you might need to call 'addSpectrum' on the object again.