Learn R Programming

tidysynthesis (version 0.1.2)

synth_spec_extractor_api: Add, update, or remove extractors from a synth_spec object

Description

Add, update, or remove extractors from a synth_spec object

Usage

add_custom_extractors(synth_spec, ...)

update_custom_extractors(synth_spec, ...)

remove_custom_extractors(synth_spec)

Value

A new synth_spec object.

A new synth_spec object with added custom extractors.

A new synth_spec object with updated custom extractors.

A new synth_spec object with removed custom extractors.

Arguments

synth_spec

A synth_spec object

...

Optional named lists with two elements, vars and extractor, mapping variable names to extractors.

Examples

Run this code

synth_spec <- synth_spec()

add_custom_extractors(
  synth_spec = synth_spec, 
  list("vars" = c("a", "b", "c"), "extractor" = parsnip::extract_fit_engine)
)


synth_spec <- synth_spec()

update_custom_extractors(
  synth_spec = synth_spec, 
  list("vars" = c("a", "b", "c"), "extractor" = parsnip::extract_fit_engine)
)


synth_spec <- synth_spec()

synth_spec <- add_custom_extractors(
  synth_spec = synth_spec, 
  list("vars" = c("a", "b", "c"), "extractor" = parsnip::extract_fit_engine)
)

remove_custom_extractors(synth_spec = synth_spec)

Run the code above in your browser using DataLab