diff --git a/R/rsplit.R b/R/rsplit.R index a82b1562..d99a98cb 100644 --- a/R/rsplit.R +++ b/R/rsplit.R @@ -1,6 +1,6 @@ rsplit <- function(data, in_id, out_id) { if (!is.data.frame(data) & !is.matrix(data)) { - cli_abort("{.arg `data`} must be a data frame.") + cli_abort("{.arg data} must be a data frame.") } if (!is.integer(in_id) | any(in_id < 1)) { diff --git a/tests/testthat/_snaps/permutations.new.md b/tests/testthat/_snaps/permutations.new.md new file mode 100644 index 00000000..515f099d --- /dev/null +++ b/tests/testthat/_snaps/permutations.new.md @@ -0,0 +1,30 @@ +# no assessment set + + Code + assessment(xx$splits[[1]]) + Condition + Error in `as.data.frame()`: + ! There is no assessment data set for an `rsplit` object with class perm_split. + +# printing + + Code + permutations(mtcars, 1) + Output + # Permutation sampling + # Permuted columns: [mpg] + # A tibble: 25 x 2 + splits id + + 1 Permutations01 + 2 Permutations02 + 3 Permutations03 + 4 Permutations04 + 5 Permutations05 + 6 Permutations06 + 7 Permutations07 + 8 Permutations08 + 9 Permutations09 + 10 Permutations10 + # i 15 more rows +