This tweak to all_targets() adds the feature that, if the environment has lists of targets, such as those created by tar_plan(), it will assign a vector of those targets' names to the environment, using the name of the list object. This overwrites the list objects, but that's OK, because we have already collected them as part of the output. This means, for each list of targets, one can call any targets function with the name of the list, e.g, tar_make(static_targets), or tar_visnetwork(targets_only = TRUE, static_targets). It will not work with things like tar_load(), which do not actually run _targets.R.
This tweak to
all_targets()
adds the feature that, if the environment has lists of targets, such as those created bytar_plan()
, it will assign a vector of those targets' names to the environment, using the name of the list object. This overwrites the list objects, but that's OK, because we have already collected them as part of the output. This means, for each list of targets, one can call any targets function with the name of the list, e.g,tar_make(static_targets)
, ortar_visnetwork(targets_only = TRUE, static_targets)
. It will not work with things liketar_load()
, which do not actually run_targets.R
.