grab_baton: Grab a baton

View source: R/transfer.R

grab_batonR Documentation

Grab a baton

Description

Attempt to start a new pass by grabbing a baton object.

Usage

grab_baton(baton, loc = NULL)

Arguments

baton

R object of S3 class, created by create_baton

loc

Location of YAML file that was saved from a baton.

Details

By default, grab_baton will use the parameter for a baton that exists in the environment. If a location of a YAML file is provided via loc, then an attempt is made to load a baton from disk. The baton will only load if it had been successfully passed; if so, the baton metadata will be updated in preparation for a new pass to be performed later in the workflow. The original YAML file is overwritten to update two metedata parameters: pass_complete and relay_finish.

Value

S3 class object.

Examples

## Not run: 
# Make a baton
baton_raw <- create_baton(bundled = TRUE,
                          bundle_params = list(dir = '/path/to/relay/raw_bundle',
                          tree = c('raw', 'processed', 'metadata', 'output')))

# Pass an empty baton for illustrative purposes
baton_raw <- relay::pass_baton(baton_raw)

# Grab the baton (if later in the script)
baton_raw <- relay::grab_baton(baton_raw)

# Grab the baton (if in an entirely separate script/project)
baton_raw <- relay::grab_baton(loc = '/path/to/original/baton')

## End(Not run)

al-obrien/relay documentation built on May 6, 2023, 10:19 p.m.