1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 08:11:58 +02:00

(v1.6.0.9063) prepare new release

This commit is contained in:
2021-05-24 09:00:11 +02:00
parent 06302d296a
commit a13fd98e8b
64 changed files with 157 additions and 107 deletions

View File

@ -88,13 +88,13 @@ age <- function(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...) {
# add decimal parts of year
mod <- n_days_x_rest / n_days_reference_year
# negative mods are cases where `x_in_reference_year` > `reference` - so 'add' a year
mod[mod < 0] <- mod[mod < 0] + 1
mod[!is.na(mod) & mod < 0] <- mod[!is.na(mod) & mod < 0] + 1
# and finally add to ages
ages <- ages + mod
}
if (any(ages < 0, na.rm = TRUE)) {
ages[ages < 0] <- NA
ages[!is.na(ages) & ages < 0] <- NA
warning_("NAs introduced for ages below 0.", call = TRUE)
}
if (any(ages > 120, na.rm = TRUE)) {