normalize_stage_keys: Normalize a reference to stage keys

Description Usage Arguments Value See Also Examples

Description

For example, list('data/one', 2) would be converted to list('data', list('one')), 2).

Usage

1
normalize_stage_keys(keys, stages, to = NULL, parent_key = "")

Arguments

keys

a list. The keys to normalize.

stages

a list. The stages we're normalizing with respect to.

to

an indexing parameter. If keys refers to a single stage, attempt to find all stages from that stage to this stage (or, if this one comes first, this stage to that stage). For example, if we have stages = list(a = list(b = 1, c = 2), d = 3, e = list(f = 4, g = 5)) where the numbers are some functions, and we call normalize_stage_keys with keys = 'a/c' and to = 'e/f', then we would obtain a nested list of logicals referencing "a/c", "d", "e/f".

parent_key

character. A helper for sane recursive error handling. For example, if we try to reference key foo/bar, but a recursive call to normalize_stage_keys errors when bar isn't found, we would still like the error to display the full name (foo/bar).

Value

a list. The format is nested logicals. For example, if stages is list(one = stageRunner$new(new.env(), list(subone = function(cx) 1)), two = function(cx) 1) then normalize_stage_keys('one/subone') would return list(one = list(subone = TRUE), two = FALSE).

See Also

stageRunner__run

Examples

1
2
3
4
5
6
## Not run: 
  stopifnot(identical(normalize_stage_keys("foo/bar",
    list(foo = list(bar = NULL, baz = NULL))),
    list(list(TRUE, FALSE))))

## End(Not run)

syberia/stagerunner documentation built on May 30, 2019, 10:41 p.m.