tidymodels / spatialsample

Create and summarize spatial resampling objects 🗺
https://spatialsample.tidymodels.org
Other
71 stars 5 forks source link

Add repeat argument to spatial_block_cv() #122

Closed mikemahoney218 closed 1 year ago

mikemahoney218 commented 1 year ago

This PR fixes #117 by adding a repeats argument to spatial_block_cv().

I've added the argument after ..., because I want to add it after v for consistency, but don't know if this merits a breaking change. The argument goes after v in rsample and spatial_buffer_vfold_cv(), but doing so here would be breaking for the other four functions in spatialsample.

library(spatialsample)

spatial_block_cv(
  boston_canopy,
  v = 2,
  repeats = 2
)
#> #  2-fold spatial block cross-validation 
#> # A tibble: 4 × 3
#>   splits            id      id2  
#>   <list>            <chr>   <chr>
#> 1 <split [363/319]> Repeat1 Fold1
#> 2 <split [319/363]> Repeat1 Fold2
#> 3 <split [340/342]> Repeat2 Fold1
#> 4 <split [342/340]> Repeat2 Fold2

Created on 2022-11-09 by the reprex package (v2.0.1)

github-actions[bot] commented 1 year ago

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.