subtargets: List sub-targets *[Stable]*

View source: R/dynamic.R

subtargetsR Documentation

List sub-targets [Stable]

Description

List the sub-targets of a dynamic target.

Usage

subtargets(
  target = NULL,
  character_only = FALSE,
  cache = drake::drake_cache(path = path),
  path = NULL
)

Arguments

target

Character string or symbol, depending on character_only. Name of a dynamic target.

character_only

Logical, whether target should be treated as a character or a symbol. Just like character.only in library().

cache

drake cache. See new_cache(). If supplied, path is ignored.

path

Path to a drake cache (usually a hidden ⁠.drake/⁠ folder) or NULL.

Value

Character vector of sub-target names

See Also

get_trace(), read_trace()

Examples

## Not run: 
isolate_example("dynamic branching", {
plan <- drake_plan(
  w = c("a", "a", "b", "b"),
  x = seq_len(4),
  y = target(x + 1, dynamic = map(x)),
  z = target(sum(x) + sum(y), dynamic = group(x, y, .by = w))
)
make(plan)
subtargets(y)
subtargets(z)
readd(x)
readd(y)
readd(z)
})

## End(Not run)

drake documentation built on Nov. 6, 2023, 5:09 p.m.