Select target objects from a target list.

tar_select_targets(targets, ...)



A list of target objects as described in the "Target objects" section. It does not matter how nested the list is as long as the only leaf nodes are targets.


One or more comma-separated tidyselect expressions, e.g. starts_with("prefix"). Just like ... in dplyr::select().


A list of target objects. See the "Target objects" section of this help file.

Target objects

Most tarchetypes functions are target factories, which means they return target objects or lists of target objects. Target objects represent skippable steps of the analysis pipeline as described at Please read the walkthrough at to understand the role of target objects in analysis pipelines.

For developers, explains target factories (functions like this one which generate targets) and the design specification at details the structure and composition of target objects.

See also

Other target selection: tar_select_names()


if (identical(Sys.getenv("TAR_LONG_EXAMPLES"), "true")) { targets::tar_dir({ # tar_dir() runs code from a temporary directory. targets <- list( list( targets::tar_target(x, 1), targets::tar_target(y1, 2) ), targets::tar_target(y2, 3), targets::tar_target(z, 4) ) tar_select_targets(targets, starts_with("y"), contains("z")) }) }