fix (cutData.R): don't overwrite existing "year" columns w/ yearseason #406
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 PR fixes #404. cc @mooibroekd.
In short, when using
cutData()
w/ "yearseason" openair would overwrite existingyear
columns.I've renamed the interim columns to be
openair__year
andopenair__month
, which are then deleted before the data is returned.Using interim columns feels dodgy; a safer bet would be working on the vectors themselves I think. But this fix should work for the time being.
I note the function does leave a floating
season
column in the output which the user has not requested, but I don't want to remove it too in case the user already has aseason
column.There may be broader improvements needed to how
cutData()
works in future - it can be very destructive to the user's own data if they're not careful.Created on 2025-01-22 with reprex v2.1.1