diff --git a/R/arguments.R b/R/arguments.R index 901ca4f4c..1f4c2a788 100644 --- a/R/arguments.R +++ b/R/arguments.R @@ -102,6 +102,7 @@ set_mode <- function(object, mode, ...) { #' for these values (e.g., `quantile_levels = 0.5` is the median). #' @export set_mode.model_spec <- function(object, mode, quantile_levels = NULL, ...) { + check_dots_empty() cls <- class(object)[1] if (rlang::is_missing(mode)) { spec_modes <- rlang::env_get(get_model_env(), paste0(cls, "_modes")) diff --git a/R/predict.R b/R/predict.R index 51b6dc46f..b3b451517 100644 --- a/R/predict.R +++ b/R/predict.R @@ -203,7 +203,7 @@ check_pred_type <- function(object, type, ..., call = rlang::caller_env()) { "censored regression" = "time", "quantile regression" = "quantile", cli::cli_abort( - "{.arg type} should be one of {.val {all_modes}}.", + "{.arg type} should be one of {.or {.val {all_modes}}}.", call = call ) ) diff --git a/R/predict_quantile.R b/R/predict_quantile.R index 497f41482..80671acb4 100644 --- a/R/predict_quantile.R +++ b/R/predict_quantile.R @@ -1,7 +1,7 @@ #' @keywords internal #' @rdname other_predict -#' @param quantile_levels A vector of values between zero and one for the -#' quantile to be predicted. If the model has a `"censored regression"` mode, +#' @param quantile_levels A vector of values between 0 and 1 for the +#' quantile to be predicted. If the model has a `"quantile regression"` mode, #' this value should be `NULL`. For other modes, the default is `(1:9)/10`. #' @inheritParams predict.model_fit #' @method predict_quantile model_fit @@ -13,7 +13,7 @@ predict_quantile.model_fit <- function(object, interval = "none", level = 0.95, ...) { - +check_dots_empty() check_spec_pred_type(object, "quantile") if (inherits(object$fit, "try-error")) { diff --git a/R/print.R b/R/print.R index 51a6f4de8..d03dcfcdb 100644 --- a/R/print.R +++ b/R/print.R @@ -23,7 +23,7 @@ print_model_spec <- function(x, cls = class(x)[1], desc = get_model_desc(cls), . print(show_call(x)) } - if ( x$mode == "quantile regression" ) { + if (x$mode == "quantile regression") { cli::cli_inform("Quantile levels: {x$quantile_levels}.") }