R/is_pipe.R

Defines functions is_pipe

is_pipe <- function(x) {
  if(is.list(x) | (is.character(x) & length(x) > 1)) {
    return(purrr::map_lgl(x, is_pipe))
  }
  if (is.call(x)) {
    x <- pryr::fun_calls(x)
  }
  any(x == "%>%")
}

Try the tidycode package in your browser

Any scripts or data that you put into this service are public.

tidycode documentation built on Dec. 11, 2019, 1:08 a.m.