Learn R Programming

teal (version 1.2.1)

check_decorators: Check decorators list

Description

Check if a decorators list is valid and matches the expected output names.

Usage

check_decorators(x, names = NULL)

assert_decorators(x, names = NULL, .var.name = checkmate::vname(x), add = NULL)

Value

TRUE if valid, otherwise a character(1) string describing the problem.

Arguments

x

(named list) of teal_transform_module() objects, or nested lists thereof.

names

(character) optional vector of valid output names. When provided, all names in x must be one of these names, and names must be unique.

.var.name

[character(1)]
The custom name for x as passed to any assert* function. Defaults to a heuristic name lookup.

add

If an AssertCollection is provided, the error message is stored in it. If NULL, an exception is raised if res is not TRUE.

See Also

module_transform_data()

Examples

Run this code
decorator <- teal_transform_module(server = function(id, data) data)
check_decorators(decorator)
check_decorators(list(all = decorator))
check_decorators(list(all = decorator, output = decorator))
check_decorators(list(all = decorator, output = list(decorator, decorator)))

Run the code above in your browser using DataLab