R/remove_surg_from_fac.R

Defines functions remove_surg_from_fac

Documented in remove_surg_from_fac

remove_surg_from_fac <- function(new_surg, uq_fac){

    new_surg_str <- new_surg %>% stringr::str_split("__") %>% paste0(collapse="|")

    uq_fac %>% stringr::str_split("__") %>%
        unlist() %>%
        purrr::keep(
            !(stringr::str_detect(.,new_surg_str))
        ) %>%
        paste(collapse="__")
}
utah-osa/hcctools documentation built on July 11, 2020, 8:59 p.m.