R/extract.R

Defines functions extract_parameter_dials.parameters

#' @export
extract_parameter_dials.parameters <- function(x, parameter, ...) {
  check_dots_empty()
  check_string(parameter, allow_empty = FALSE)

  which_id <- which(x$id == parameter)
  if (length(which_id) == 0) {
    rlang::abort(paste0("No parameter exists with id '", parameter, "'."))
  }

  x$object[[which_id]]
}

Try the dials package in your browser

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

dials documentation built on April 3, 2023, 5:43 p.m.