From bd5f46d734ec48f900c5980c3bc4d08f037dee8b Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Sun, 16 Dec 2018 09:50:14 +0100 Subject: [PATCH] age_groups fix --- R/age.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/age.R b/R/age.R index ac0aff7b..2bad6437 100644 --- a/R/age.R +++ b/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) }