It is sometimes useful to have access to certain objects which are generated as side-products in a source script which yields as a main-product one or more targets. Typically these objects are used for checking that the targets were produced as expected.

make_register(value, name, quiet = FALSE)

Arguments

value

A value to be registered in a source script and returned as part of the Segment

name

A variable name, given as a character string. No coercion is done, and the first element of a character vector of length greater than one will be used, with a warning.

quiet

A logical determining whether or not warnings are signaled when make_register() is called outside of a 'makepipe' pipeline

Value

value invisibly

Examples


if (FALSE) {
  # Imagine this is part of your source script:
  x <- readRDS("input.Rds")
  x <- do_stuff(x)
  chk <- do_check(x)
  make_register(chk, "x_check")
  saveRDS(x, "output.Rds")

  # You will have access to `chk` in your pipeline script:
  step_one <- make_with_source(
    "source.R",
    "output.Rds",
    "input.Rds",
  )
  step_one$result$chk
}