layer-processors: Extract, validate, or detect layers of frosting

extract_layersR Documentation

Extract, validate, or detect layers of frosting

Description

These functions are mainly internal. They can access and validate different layers of frosting.

Usage

extract_layers(x, ...)

## S3 method for class 'frosting'
extract_layers(x, ...)

## S3 method for class 'workflow'
extract_layers(x, ...)

is_layer(x)

validate_layer(x, ..., arg = rlang::caller_arg(x), call = caller_env())

detect_layer(x, name, ...)

## S3 method for class 'frosting'
detect_layer(x, name, ...)

## S3 method for class 'workflow'
detect_layer(x, name, ...)

Arguments

x

an epi_workflow, frosting, or layer object

...

additional arguments for possible future methods

arg

the name of the input (for error reporting)

call

the environment (for error reporting)

name

a layer name to detect

Value

A logical for the validators/detectors or a list of layers for the extractors

Examples


f <- frosting() %>% layer_predict()
wf <- epi_workflow(postprocessor = f)

is_layer(layer("what_the_what"))
detect_layer(f, "layer_predict")
detect_layer(wf, "layer_predict")

extract_layers(f)
extract_layers(wf)

cmu-delphi/epipredict documentation built on March 5, 2025, 12:17 p.m.