R/tar_pipeline.R

Defines functions tar_pipeline

Documented in tar_pipeline

#' @title Declare a pipeline (deprecated).
#' @export
#' @keywords internal
#' @description Functions `tar_pipeline()` and [tar_bind()] are deprecated.
#'   Instead, simply end your target script file (default: `_targets.R`)
#'   with a list of target objects.
#'   You can nest these objects however you like.
#' @details Deprecated on 2021-01-03.
#' @return A pipeline object.
#' @param ... Targets or lists of targets defined with [tar_target()].
#' @examples
#' # In _targets.R:
#' library(targets)
#' list( # You no longer need tar_pipeline() here.
#'   tar_target(data_file, "data.csv", format = "file"),
#'   list( # Target lists can be arbitrarily nested.
#'     tar_target(data_object, read.csv(data_file)),
#'     tar_target(analysis, analyze(data_object))
#'   )
#' )
tar_pipeline <- function(...) {
  tar_warn_deprecate(
    "tar_pipeline() is deprecated in targets version >= 0.0.0.9004. ",
    "Simply end your target script file (default: `_targets.R`) ",
    "with a list of tar_target() objects (arbitrarily nested)."
  )
  pipeline_init(unlist(list(...), recursive = TRUE))
}

Try the targets package in your browser

Any scripts or data that you put into this service are public.

targets documentation built on Oct. 12, 2023, 5:07 p.m.