diff --git a/R/boot.R b/R/boot.R index edb40593..13cff66b 100644 --- a/R/boot.R +++ b/R/boot.R @@ -76,7 +76,7 @@ bootstraps <- if (length(strata) == 0) strata <- NULL } - strata_check(strata, data) + check_strata(strata, data) split_objs <- boot_splits( diff --git a/R/initial_validation_split.R b/R/initial_validation_split.R index 4d89ebc6..95f8f884 100644 --- a/R/initial_validation_split.R +++ b/R/initial_validation_split.R @@ -68,7 +68,7 @@ initial_validation_split <- function(data, strata <- NULL } } - strata_check(strata, data) + check_strata(strata, data) split_train <- mc_cv( data = data, @@ -209,7 +209,7 @@ group_initial_validation_split <- function(data, strata <- NULL } } - strata_check(strata, data) + check_strata(strata, data) if (missing(strata)) { split_train <- group_mc_cv( diff --git a/R/mc.R b/R/mc.R index 12d80677..35ebfd49 100644 --- a/R/mc.R +++ b/R/mc.R @@ -58,7 +58,7 @@ mc_cv <- function(data, prop = 3 / 4, times = 25, if (length(strata) == 0) strata <- NULL } - strata_check(strata, data) + check_strata(strata, data) split_objs <- mc_splits( diff --git a/R/misc.R b/R/misc.R index 55a60fa5..df2c3b70 100644 --- a/R/misc.R +++ b/R/misc.R @@ -98,7 +98,7 @@ add_class <- function(x, cls) { x } -strata_check <- function(strata, data, call = caller_env()) { +check_strata <- function(strata, data, call = caller_env()) { check_string(strata, allow_null = TRUE, call = call) if (!is.null(strata)) { diff --git a/R/validation_split.R b/R/validation_split.R index 26e5e947..bbe509b1 100644 --- a/R/validation_split.R +++ b/R/validation_split.R @@ -67,7 +67,7 @@ validation_split <- function(data, prop = 3 / 4, } } - strata_check(strata, data) + check_strata(strata, data) split_objs <- mc_splits( diff --git a/R/vfold.R b/R/vfold.R index 2a2ac616..faded51e 100644 --- a/R/vfold.R +++ b/R/vfold.R @@ -71,7 +71,7 @@ vfold_cv <- function(data, v = 10, repeats = 1, if (length(strata) == 0) strata <- NULL } - strata_check(strata, data) + check_strata(strata, data) check_repeats(repeats) if (repeats == 1) { diff --git a/tests/testthat/_snaps/make_strata.md b/tests/testthat/_snaps/make_strata.md index 2ffab7ba..764eb421 100644 --- a/tests/testthat/_snaps/make_strata.md +++ b/tests/testthat/_snaps/make_strata.md @@ -67,7 +67,7 @@ # don't stratify on Surv objects Code - strata_check("surv", df) + check_strata("surv", df) Condition Error: ! `strata` cannot be a object. diff --git a/tests/testthat/test-make_strata.R b/tests/testthat/test-make_strata.R index 3704783b..08ace53f 100644 --- a/tests/testthat/test-make_strata.R +++ b/tests/testthat/test-make_strata.R @@ -39,7 +39,7 @@ test_that("bad data", { -# strata_check() ---------------------------------------------------------- +# check_strata() ---------------------------------------------------------- test_that("don't stratify on Surv objects", { df <- data.frame( @@ -58,6 +58,6 @@ test_that("don't stratify on Surv objects", { ) expect_snapshot(error = TRUE, { - strata_check("surv", df) + check_strata("surv", df) }) }) diff --git a/tests/testthat/test-vfold.R b/tests/testthat/test-vfold.R index 369a0008..3bf8dff6 100644 --- a/tests/testthat/test-vfold.R +++ b/tests/testthat/test-vfold.R @@ -79,7 +79,7 @@ test_that("strata arg is checked", { vfold_cv(iris, strata = iris$Species) }) - # errors from `strata_check()` + # errors from `check_strata()` expect_snapshot(error = TRUE, { vfold_cv(iris, strata = c("Species", "Sepal.Width")) })