R/blueprint-xy.R

Defines functions check_xy_blueprint refresh_blueprint.xy_blueprint new_xy_blueprint

Documented in new_xy_blueprint

#' @rdname new-blueprint
#' @export
new_xy_blueprint <- function(intercept = FALSE,
                             allow_novel_levels = FALSE,
                             composition = "tibble",
                             ptypes = NULL,
                             ...,
                             subclass = character()) {
  new_blueprint(
    intercept = intercept,
    allow_novel_levels = allow_novel_levels,
    composition = composition,
    ptypes = ptypes,
    ...,
    subclass = c(subclass, "xy_blueprint")
  )
}

#' @export
refresh_blueprint.xy_blueprint <- function(blueprint) {
  do.call(new_xy_blueprint, as.list(blueprint))
}

check_xy_blueprint <- function(x,
                               ...,
                               arg = caller_arg(x),
                               call = caller_env()) {
  check_inherits(x, "xy_blueprint", arg = arg, call = call)
}

Try the hardhat package in your browser

Any scripts or data that you put into this service are public.

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