update_blueprint: Update a preprocessing blueprint

View source: R/blueprint.R

update_blueprintR Documentation

Update a preprocessing blueprint


update_blueprint() is the correct way to alter elements of an existing blueprint object. It has two benefits over just doing blueprint$elem <- new_elem.

  • The name you are updating must already exist in the blueprint. This prevents you from accidentally updating non-existent elements.

  • The constructor for the blueprint is automatically run after the update by refresh_blueprint() to ensure that the blueprint is still valid.


update_blueprint(blueprint, ...)



A preprocessing blueprint.


Name-value pairs of existing elements in blueprint that should be updated.


blueprint <- default_xy_blueprint()

# `intercept` defaults to FALSE

update_blueprint(blueprint, intercept = TRUE)

# Can't update non-existent elements
try(update_blueprint(blueprint, intercpt = TRUE))

# Can't add non-valid elements
try(update_blueprint(blueprint, intercept = 1))

hardhat documentation built on March 31, 2023, 10:21 p.m.