Skip to content

Commit 167783c

Browse files
authored
Merge pull request #598 from tidymodels/reframe
Update example for `group_vfold_cv()`
2 parents f24220a + b419f81 commit 167783c

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
* The lag argument for `initial_time_split()` has been soft deprecated (@bjornkallerud, #592).
44

5+
* The example for `group_vfold_cv()` has been updated to use current dplyr functions (#597).
6+
7+
58
# rsample 1.3.1
69

710
* The new `internal_calibration_split()` function and its methods for various resamples is for usage in tune to create a internal split of the analysis set to fit the preprocessor and model on one part and the post-processor on the other part (#483, #488, #489, #569, #575, #577, #582).

R/vfold.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ vfold_cv <- function(
120120

121121
## Save some overall information
122122

123-
if (!is.null(strata)) names(strata) <- NULL
123+
if (!is.null(strata)) {
124+
names(strata) <- NULL
125+
}
124126
cv_att <- list(
125127
v = v,
126128
repeats = repeats,
@@ -230,8 +232,8 @@ vfold_splits <- function(
230232
#' city_strata <- Sacramento |>
231233
#' group_by(city) |>
232234
#' summarize(strata = mean(price)) |>
233-
#' summarize(city = city,
234-
#' strata = cut(strata, quantile(strata), include.lowest = TRUE))
235+
#' reframe(city = city,
236+
#' strata = cut(strata, quantile(strata), include.lowest = TRUE))
235237
#'
236238
#' sacramento_data <- Sacramento |>
237239
#' full_join(city_strata, by = "city")

man/group_vfold_cv.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)