Conversation
hfrick
approved these changes
Dec 9, 2022
Member
hfrick
left a comment
There was a problem hiding this comment.
That looks good to me! Just a minor comment on the docs
| #' to partition the data into disjointed sets via clustering. | ||
| #' This argument is ignored (with a warning) if `data` is an `sf` object. | ||
| #' @inheritParams buffer_indices | ||
| #' @inheritParams rsample::clustering_cv |
Member
There was a problem hiding this comment.
this leads to the docs for distance_function to state that the default would be stats::dist()
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #120 and fixes #104 by wrapping
rsample::clustering_cv().There's three big (breaking) changes here that I'm aware of:
spatial_clustering_cv()no longer handles non-sfobjects, because I think they'd be better handled viarsample::clustering_cv().distance_functionargument is now a function by default, and gets assigned as an attribute to the resulting rset, thedistance_functionattribute winds up having a somewhat complex environment, which is non-intuitive:Created on 2022-12-08 by the reprex package (v2.0.1)
I'm not sure if there's a good way to "zero out" that environment, so that we aren't accidentally dragging extra data along.
Otherwise, this function should work the same as it always has.