Name matchData()'s arguments for what they are - #23
Merged
Conversation
The function joins two sf point objects by space and time. It was never specific to species observations or environmental data, but `speciesDat` and `envDat` described one use of it as though it were the only one - and the docs followed the names, so the general case was invisible. `dat` is the side that gets columns added; `source` is the side they come from. Tag positions against a model field, moorings against satellite retrievals, one gridded product against another: all the same operation, and now all obviously so. A test matches two grids to each other with nothing species-shaped involved. The old names still work and warn. taupatch calls them by name at R/covariates.R:271, and any script written against the old signature does too; breaking those silently is worse than carrying a shim. Checked against taupatch's exact call form after rebuilding. The collision suffix moves from ".env" to ".matched" for the same reason. Nothing depended on the old one - checked across this package, taupatch, and derivoce. Internals follow: detect_temporal_resolution() takes `x` rather than `envDat`, standardize_time_columns() takes `dat`, and their errors name `dat` rather than a species dataset. Every call site in the roxygen and the README now shows the new names. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
matchData()joins twosfpoint objects by space and time. It was never specific to species observations or environmental data — butspeciesDatandenvDatdescribed one use of it as though it were the only one, and the docs followed the names, so the general case was invisible.datis the side that gets columns added;sourceis the side they come from. Tag positions against a model field, moorings against satellite retrievals, one gridded product against another — all the same operation, and now obviously so. There's a test that matches two grids to each other with nothing species-shaped involved.The old names still work
They warn, but they work:
taupatch calls them by name at
R/covariates.R:271, and any script written against the old signature does too. Breaking those silently would be worse than carrying a shim. Verified against taupatch's exact call form after rebuilding:One related change
The collision suffix moves from
.envto.matched, for the same reason. Nothing depended on the old one — checked across this package, taupatch, and derivoce.Thoroughness
The rename goes all the way down, not just the signature:
detect_temporal_resolution()takesxrather thanenvDatstandardize_time_columns()takesdat, and its errors say`dat`rather than "speciesDat"`dat`/`source`make_species_dat/make_env_dattomake_observations/make_envFour new tests: the deprecation shim (both names, and that old and new produce identical results), positional and named forms, the
.matchedsuffix leaving the caller's column untouched, and a grid-to-grid match.Verification
R CMD check— Status: OK. Full suite green. Installed into both R 4.6.1 and 4.3.2. All README anchors re-checked.🤖 Generated with Claude Code