diff --git a/R/update_hyperparameters.R b/R/update_hyperparameters.R index 76dfff9..6658339 100644 --- a/R/update_hyperparameters.R +++ b/R/update_hyperparameters.R @@ -54,14 +54,16 @@ #' #' # 'cost' is required #' # throws error -#' xpectr::capture_side_effects( -#' update_hyperparameters( -#' kernel = "linear", -#' "scale" = FALSE, -#' hyperparameters = hparams, -#' .required = "cost" +#' if (requireNamespace("xpectr", quietly = TRUE)){ +#' xpectr::capture_side_effects( +#' update_hyperparameters( +#' kernel = "linear", +#' "scale" = FALSE, +#' hyperparameters = hparams, +#' .required = "cost" +#' ) #' ) -#' ) +#' } #' #' } update_hyperparameters <- function(..., hyperparameters, .required = NULL){ diff --git a/man/update_hyperparameters.Rd b/man/update_hyperparameters.Rd index 79844ed..3cd9cfd 100644 --- a/man/update_hyperparameters.Rd +++ b/man/update_hyperparameters.Rd @@ -59,14 +59,16 @@ update_hyperparameters( # 'cost' is required # throws error -xpectr::capture_side_effects( - update_hyperparameters( - kernel = "linear", - "scale" = FALSE, - hyperparameters = hparams, - .required = "cost" +if (requireNamespace("xpectr", quietly = TRUE)){ + xpectr::capture_side_effects( + update_hyperparameters( + kernel = "linear", + "scale" = FALSE, + hyperparameters = hparams, + .required = "cost" + ) ) -) +} } }