R/age_exclusion.R

Defines functions age_exclusion

age_exclusion <- function(
  
  data,
  age_min = NULL,
  age_max = NULL
  
){
  
  
  if(is.null(age_min)){age_min <- -1000}
  if(is.null(age_max)){age_max <- 1000}
  
    stays <- data %>%
      select(id_stay, age) %>%
      filter((age < age_min) | (age > age_max)) %>%
      select(id_stay)
    
  return(stays)
  
  
}
jomuller/ITCARES documentation built on May 19, 2019, 7:26 p.m.