create_baton | R Documentation |
create_baton
is a constructor of an S3 class used for tracking workflows.
create_baton(
content = list(),
loc = NULL,
auto_assign = FALSE,
envir = .GlobalEnv,
bundled = FALSE,
bundle_params = list()
)
content |
A list of custom content that the baton should carry. |
loc |
The location of the associated YAML file (defaults to a temporary location). |
auto_assign |
Boolean value to determine if name assignment is to be automatic). |
envir |
Environment where |
bundled |
Boolean value to determine if the baton should be created within a bundle; default is set to |
bundle_params |
List of parameters to pass to |
By default, the content of the baton will be empty, only the metadata will be populated. The S3 object created will have an associated
YAML file made, in a temporary location if no set location provided to loc
. There is also the ability to automatically assign the S3 object
to the R environment in case that is easier to remember. Some behavior can be controlled by global options, such as the referee and relay type.
The metadata of a bundle includes the following:
id: unique ID of baton based upon time stamp and random numbers.
referee: defines the threshold of content to write to the logbook, 'TRACE' is the lowest and the default; can be set by global setting, options(relay_referee = "TRACE")
.
relay_type: defines the type of baton as one of 'CANCELLED', 'PRACTICE', or 'COMPETITION' (default); can be set by global setting, options(relay_type = "COMPETITION")
.
relay_start: time stamp when baton first created (matched ID).
relay_finish: time the baton was last passed (will not be populated if in middle of pass).
all_grabs: time stamps for all grabs or intercepts that occurred (excludes initial creation time).
all_passes: time stamps for all completed passes.
pass_complete: whether or not the baton completed its latest pass.
passes_completed: the number of successful passes completed.
location: where the baton YAML file has been saved.
dropped: boolean value of whether the baton has been dropped, signalling and end to the relay.
The logbook operates with write_logbook
and read_logbook
, which help track the baton without having to write contents or update the metadata.
S3 class object.
Although some generics (summary.baton
) are used in {relay}, most functions just check for the class and do not proceed unless
it is a baton. This may be rewritten to use only generics or R6 classes but right now this hybrid approach was used for simplicity.
## Not run:
my_baton <- create_baton(loc = file.path('path', 'to', 'save', 'yaml'))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.