R/tar_deps.R

Defines functions tar_deps

Documented in tar_deps

#' @title Code dependencies
#' @export
#' @family inspect
#' @seealso [tar_branches()], [tar_network()]
#' @description List the dependencies of a function or expression.
#' @details `targets` detects the dependencies of commands using
#'   static code analysis. Use `tar_deps()` to run the
#'   code analysis and see the dependencies for yourself.
#' @return Character vector of the dependencies of a function or expression.
#' @param expr A quoted R expression or function.
#' @examples
#' tar_deps(x <- y + z)
#' tar_deps({
#'   x <- 1
#'   x + a
#' })
#' tar_deps(function(a = b) map_dfr(data, ~do_row(.x)))
tar_deps <- function(expr) {
  expr <- substitute(expr)
  tar_deps_raw(expr)
}

Try the targets package in your browser

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

targets documentation built on Oct. 12, 2023, 5:07 p.m.