mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 07:26:12 +01:00
age_groups fix
This commit is contained in:
parent
2018d5b477
commit
bd5f46d734
2
R/age.R
2
R/age.R
@ -90,6 +90,7 @@ age <- function(x, y = Sys.Date()) {
|
||||
#' age_groups(ages, "children")
|
||||
#'
|
||||
#' # resistance of ciprofloxacine per age group
|
||||
#' library(dplyr)
|
||||
#' septic_patients %>%
|
||||
#' mutate(first_isolate = first_isolate(.)) %>%
|
||||
#' filter(first_isolate == TRUE,
|
||||
@ -100,6 +101,7 @@ age <- function(x, y = Sys.Date()) {
|
||||
#' ggplot_rsi(x = "age_group")
|
||||
age_groups <- function(x, split_at = c(12, 25, 55, 75)) {
|
||||
if (is.character(split_at)) {
|
||||
split_at <- split_at[1]
|
||||
if (split_at %like% "^child") {
|
||||
split_at <- c(0, 1, 2, 4, 6, 13, 18)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user