Skip to content

Commit d2755c5

Browse files
committed
Merge branch 'master' into complement-rsplit
2 parents 028a7e6 + 54e3235 commit d2755c5

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
* A few internal functions were exported so that `rsample`-adjacent packages can use the same underlying code.
1414

15+
* The `obj_sum()` method for `rsplit` objects was updated.
16+
1517
* Changed the inheritance structure for `rsplit` objects from specific to general and simplified the methods for the `complement()` generic.
1618

1719

R/rsplit.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ obj_sum.rsplit <- function(x, ...) {
139139
else
140140
paste(length(x$out_id))
141141

142-
paste0("rsplit [",
142+
paste0("split [",
143143
length(x$in_id), "/",
144144
out_char, "]")
145145
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
> set.seed(233)
2+
> print(validation_split(mtcars))
3+
# Validation Set Split (0.75/0.25)
4+
# A tibble: 1 x 2
5+
splits id
6+
<list> <chr>
7+
1 <split [24/8]> validation
8+

tests/testthat/test_rsplit.R

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ test_that('print methods', {
5151
set.seed(233)
5252
print(validation_split(mtcars)$splits[[1]])
5353
})
54+
verify_output(test_path("print_test_output", "obj_sum"), {
55+
set.seed(233)
56+
print(validation_split(mtcars))
57+
})
5458
})
5559

5660
test_that("default complement method errors", {

0 commit comments

Comments
 (0)