From 4843385f031790cb16c6ab5713926551f9897cde Mon Sep 17 00:00:00 2001 From: "Simon P. Couch" Date: Tue, 26 Apr 2022 10:42:39 -0400 Subject: [PATCH] bump kernlab to Suggests --- DESCRIPTION | 4 ++-- R/add_candidates.R | 2 +- R/blend_predictions.R | 2 +- R/butcher.R | 9 +-------- R/collect_parameters.R | 2 +- R/fit_members.R | 9 ++------- R/predict.R | 10 ++-------- man/add_candidates.Rd | 3 ++- man/axe_model_stack.Rd | 8 ++------ man/blend_predictions.Rd | 3 ++- man/collect_parameters.Rd | 2 ++ man/fit_members.Rd | 10 +++------- man/predict.model_stack.Rd | 11 +++-------- tests/testthat/test_add_candidates.R | 3 +++ tests/testthat/test_blend_predictions.R | 3 +++ tests/testthat/test_butcher.R | 3 +++ tests/testthat/test_collect_parameters.R | 3 +++ tests/testthat/test_cran.R | 3 +++ tests/testthat/test_expressions.R | 3 +++ tests/testthat/test_fit_members.R | 3 +++ tests/testthat/test_plots.R | 3 +++ tests/testthat/test_predict.R | 3 +++ tests/testthat/test_print.R | 3 +++ tests/testthat/test_utils.R | 3 +++ 24 files changed, 57 insertions(+), 51 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c0cbe201..4a51e39b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -42,8 +42,7 @@ Imports: glmnet, cli, stats, - foreach, - kernlab + foreach Suggests: testthat (>= 3.0.0), covr, @@ -53,6 +52,7 @@ Suggests: modeldata, rmarkdown, nnet, + kernlab, h2o, SuperLearner Config/Needs/website: diff --git a/R/add_candidates.R b/R/add_candidates.R index bc338625..1eb8e335 100644 --- a/R/add_candidates.R +++ b/R/add_candidates.R @@ -34,7 +34,7 @@ #' #' @template note_example_data #' -#' @examples +#' @examplesIf rlang::is_installed("kernlab") #' \donttest{ #' # see the "Example Data" section above for #' # clarification on the objects used in these examples! diff --git a/R/blend_predictions.R b/R/blend_predictions.R index 26d9436c..786c62d3 100644 --- a/R/blend_predictions.R +++ b/R/blend_predictions.R @@ -54,7 +54,7 @@ #' #' @template note_example_data #' -#' @examples +#' @examplesIf rlang::is_installed("kernlab") #' \donttest{ #' # see the "Example Data" section above for #' # clarification on the objects used in these examples! diff --git a/R/butcher.R b/R/butcher.R index 112163f2..b29aa2c9 100644 --- a/R/butcher.R +++ b/R/butcher.R @@ -12,12 +12,7 @@ butcher::butcher #' #' @return Axed model_stack object. #' -#' -#' @examples -#' # feel free to ignore the following lines—they allow {stacks} to supply -#' # examples without requiring the model-supplying package to be installed. -#' if (requireNamespace("ranger", quietly = TRUE)) { -#' if (requireNamespace("kernlab", quietly = TRUE)) { +#' @examplesIf rlang::is_installed("ranger") & rlang::is_installed("kernlab") #' #' \donttest{ #' @@ -43,8 +38,6 @@ butcher::butcher #' format(object.size(st)) #' format(object.size(butchered_st)) #' -#' } -#' } #' } #' @name axe_model_stack NULL diff --git a/R/collect_parameters.R b/R/collect_parameters.R index 250fa55b..5e442bd6 100644 --- a/R/collect_parameters.R +++ b/R/collect_parameters.R @@ -17,7 +17,7 @@ #' #' @template note_example_data #' -#' @examples +#' @examplesIf rlang::is_installed("kernlab") #' \donttest{ #' # see the "Example Data" section above for #' # clarification on the objects used in these examples! diff --git a/R/fit_members.R b/R/fit_members.R index 4b643e13..fc45f4ea 100644 --- a/R/fit_members.R +++ b/R/fit_members.R @@ -20,11 +20,7 @@ #' #' @template note_example_data #' -#' @examples -#' # feel free to ignore the following lines—they allow {stacks} to supply -#' # examples without requiring the model-supplying package to be installed. -#' if (requireNamespace("ranger", quietly = TRUE)) { -#' if (requireNamespace("kernlab", quietly = TRUE)) { +#' @examplesIf rlang::is_installed("ranger") & rlang::is_installed("kernlab") #' #' \donttest{ #' @@ -66,8 +62,7 @@ #' fit_members() #' #' log_st -#' } -#' } +#' #' } #' #' @family core verbs diff --git a/R/predict.R b/R/predict.R index b8197840..a52051d8 100644 --- a/R/predict.R +++ b/R/predict.R @@ -15,12 +15,7 @@ #' #' @template note_example_data #' -#' @examples -#' # feel free to ignore the following lines—they allow {stacks} to supply -#' # examples without requiring the model-supplying package to be installed. -#' if (requireNamespace("ranger", quietly = TRUE)) { -#' if (requireNamespace("kernlab", quietly = TRUE)) { -#' +#' @examplesIf rlang::is_installed("ranger") & rlang::is_installed("kernlab") #' \donttest{ #' #' # see the "Example Data" section above for @@ -68,8 +63,7 @@ #' type = "prob", #' members = TRUE #' ) -#' } -#' } +#' #' } #' #' @importFrom stats predict diff --git a/man/add_candidates.Rd b/man/add_candidates.Rd index 4184e042..65c6832b 100644 --- a/man/add_candidates.Rd +++ b/man/add_candidates.Rd @@ -96,6 +96,7 @@ the source code that generated them. } \examples{ +\dontshow{if (rlang::is_installed("kernlab")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \donttest{ # see the "Example Data" section above for # clarification on the objects used in these examples! @@ -138,7 +139,7 @@ log_st2 # passed to blend_predictions(): log_st2 \%>\% blend_predictions() } - +\dontshow{\}) # examplesIf} } \seealso{ Other core verbs: diff --git a/man/axe_model_stack.Rd b/man/axe_model_stack.Rd index e2202c30..0d7952e4 100644 --- a/man/axe_model_stack.Rd +++ b/man/axe_model_stack.Rd @@ -45,10 +45,7 @@ Remove environments. Remove fitted values. } \examples{ -# feel free to ignore the following lines—they allow {stacks} to supply -# examples without requiring the model-supplying package to be installed. -if (requireNamespace("ranger", quietly = TRUE)) { - if (requireNamespace("kernlab", quietly = TRUE)) { +\dontshow{if (rlang::is_installed("ranger") & rlang::is_installed("kernlab")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \donttest{ @@ -74,7 +71,6 @@ butchered_st <- butcher(st, verbose = TRUE) format(object.size(st)) format(object.size(butchered_st)) - } - } } +\dontshow{\}) # examplesIf} } diff --git a/man/blend_predictions.Rd b/man/blend_predictions.Rd index e2d44468..01640791 100644 --- a/man/blend_predictions.Rd +++ b/man/blend_predictions.Rd @@ -122,6 +122,7 @@ the source code that generated them. } \examples{ +\dontshow{if (rlang::is_installed("kernlab")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \donttest{ # see the "Example Data" section above for # clarification on the objects used in these examples! @@ -178,7 +179,7 @@ log_st <- log_st } - +\dontshow{\}) # examplesIf} } \seealso{ Other core verbs: diff --git a/man/collect_parameters.Rd b/man/collect_parameters.Rd index 021b91fb..e43a2dac 100644 --- a/man/collect_parameters.Rd +++ b/man/collect_parameters.Rd @@ -82,6 +82,7 @@ the source code that generated them. } \examples{ +\dontshow{if (rlang::is_installed("kernlab")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \donttest{ # see the "Example Data" section above for # clarification on the objects used in these examples! @@ -108,4 +109,5 @@ collect_parameters( "spline" ) } +\dontshow{\}) # examplesIf} } diff --git a/man/fit_members.Rd b/man/fit_members.Rd index db97e190..896c1c2c 100644 --- a/man/fit_members.Rd +++ b/man/fit_members.Rd @@ -75,10 +75,7 @@ the source code that generated them. } \examples{ -# feel free to ignore the following lines—they allow {stacks} to supply -# examples without requiring the model-supplying package to be installed. -if (requireNamespace("ranger", quietly = TRUE)) { - if (requireNamespace("kernlab", quietly = TRUE)) { +\dontshow{if (rlang::is_installed("ranger") & rlang::is_installed("kernlab")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \donttest{ @@ -120,10 +117,9 @@ log_st <- fit_members() log_st - } - } -} +} +\dontshow{\}) # examplesIf} } \seealso{ Other core verbs: diff --git a/man/predict.model_stack.Rd b/man/predict.model_stack.Rd index ce19a1d9..22ed2c10 100644 --- a/man/predict.model_stack.Rd +++ b/man/predict.model_stack.Rd @@ -74,11 +74,7 @@ the source code that generated them. } \examples{ -# feel free to ignore the following lines—they allow {stacks} to supply -# examples without requiring the model-supplying package to be installed. -if (requireNamespace("ranger", quietly = TRUE)) { - if (requireNamespace("kernlab", quietly = TRUE)) { - +\dontshow{if (rlang::is_installed("ranger") & rlang::is_installed("kernlab")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} \donttest{ # see the "Example Data" section above for @@ -126,8 +122,7 @@ predict( type = "prob", members = TRUE ) - } - } -} } +\dontshow{\}) # examplesIf} +} diff --git a/tests/testthat/test_add_candidates.R b/tests/testthat/test_add_candidates.R index 5c621064..a107f8b0 100644 --- a/tests/testthat/test_add_candidates.R +++ b/tests/testthat/test_add_candidates.R @@ -12,6 +12,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_blend_predictions.R b/tests/testthat/test_blend_predictions.R index 156d8e4d..99520b39 100644 --- a/tests/testthat/test_blend_predictions.R +++ b/tests/testthat/test_blend_predictions.R @@ -12,6 +12,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_butcher.R b/tests/testthat/test_butcher.R index 70699056..3f33b589 100644 --- a/tests/testthat/test_butcher.R +++ b/tests/testthat/test_butcher.R @@ -12,6 +12,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_collect_parameters.R b/tests/testthat/test_collect_parameters.R index c466a093..76e3d2f6 100644 --- a/tests/testthat/test_collect_parameters.R +++ b/tests/testthat/test_collect_parameters.R @@ -12,6 +12,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_cran.R b/tests/testthat/test_cran.R index 7a4573ac..b629b484 100644 --- a/tests/testthat/test_cran.R +++ b/tests/testthat/test_cran.R @@ -8,6 +8,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_expressions.R b/tests/testthat/test_expressions.R index c8993ec7..e888e108 100644 --- a/tests/testthat/test_expressions.R +++ b/tests/testthat/test_expressions.R @@ -6,6 +6,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_fit_members.R b/tests/testthat/test_fit_members.R index 88974f5b..e2761e44 100644 --- a/tests/testthat/test_fit_members.R +++ b/tests/testthat/test_fit_members.R @@ -12,6 +12,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_plots.R b/tests/testthat/test_plots.R index db2eb9dd..3d6b76bf 100644 --- a/tests/testthat/test_plots.R +++ b/tests/testthat/test_plots.R @@ -12,6 +12,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_predict.R b/tests/testthat/test_predict.R index 4cff2218..dea5f586 100644 --- a/tests/testthat/test_predict.R +++ b/tests/testthat/test_predict.R @@ -12,6 +12,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_print.R b/tests/testthat/test_print.R index e72e1fb7..7ad20428 100644 --- a/tests/testthat/test_print.R +++ b/tests/testthat/test_print.R @@ -12,6 +12,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet) diff --git a/tests/testthat/test_utils.R b/tests/testthat/test_utils.R index d7fecaed..a01d2033 100644 --- a/tests/testthat/test_utils.R +++ b/tests/testthat/test_utils.R @@ -12,6 +12,9 @@ library(modeldata) skip_if_not_installed("ranger") library(ranger) +skip_if_not_installed("kernlab") +library(kernlab) + skip_if_not_installed("nnet") library(nnet)