R/getCurrentInBed.R

Defines functions getCurrentInBed

Documented in getCurrentInBed

#' getCurrentInBed
#'
#' @param df df
#' @param date date
#' @param UTI UTI
#'
#' @export
#'
getCurrentInBed = function(df, date, UTI){
  if (!UTI) {
    df = df %>%
      filter(dt_int <= date & (dt_evo >= date | is.na(dt_evo)))
  }else{
    df = df %>%
      filter(UTI == 1, dt_entuti <= date & (dt_saiuti >= date | is.na(dt_saiuti)))
  }
}
covid19br/now_fcts documentation built on Feb. 10, 2021, 9:42 a.m.