1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 18:01:50 +02:00

(v0.7.1.9072) key_antibiotics() for foreign systems

This commit is contained in:
2019-09-12 15:08:53 +02:00
parent b5d2a08401
commit cd178ee569
28 changed files with 1640 additions and 119 deletions

View File

@ -145,6 +145,10 @@ age_groups <- function(x, split_at = c(12, 25, 55, 75), na.rm = FALSE) {
if (!is.numeric(x)) {
stop("`x` and must be numeric, not a ", paste0(class(x), collapse = "/"), ".")
}
if (any(x < 0, na.rm = TRUE)) {
x[x < 0] <- NA
warning("NAs introduced for ages below 0.")
}
if (is.character(split_at)) {
split_at <- split_at[1L]
if (split_at %like% "^(child|kid|junior)") {