Learn R Programming

drake (version 4.2.0)

deps: Function deps

Description

List the dependencies of a function or workflow plan command.

Usage

deps(x)

Arguments

x

Either a function or a string. Strings are commands from your workflow plan data frame.

Value

names of dependencies. Files wrapped in single quotes. The other names listed are functions or generic objects.

Examples

Run this code
# NOT RUN {
f <- function(x, y){
  out <- x + y + g(x)
  saveRDS(out, 'out.rds')
}
deps(f)
my_plan <- plan(
  x = 1 + some_object,
  my_target = x + readRDS('tracked_input_file.rds'),
  return_value = f(x, y, g(z + w))
)
deps(my_plan$command[1])
deps(my_plan$command[2])
deps(my_plan$command[3])
# }

Run the code above in your browser using DataLab