Select the names of targets from a target list.

tar_select_names(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 character vector of target names.

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_targets()


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_names(targets, starts_with("y"), contains("z")) }) }