R/fun_calls.R

Defines functions fun_calls

Documented in fun_calls

#' @title Function Calls
#'
#' @export


fun_calls <- function(curr, fns) {
  return(
    sapply(
      X = 1:(curr %>% length),
      FUN = function(x) {
        sapply(
          X = fns,
          FUN = function(y) {
            if (curr[x] %>% grepl(pattern = paste0(y, "(\\(|\\)| )"))) y else c()
          }
        ) %>%
          purrr::flatten_chr()
      }
    ) %>%
      purrr::flatten_chr()
  )
}
ntyndall/wireR documentation built on May 18, 2019, 3:44 p.m.