-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement proper tidyselect for epi_slide_opt
#452
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c1cfe09
remove renaming options from epi_opt_slide. remove col_names checks
nmdefries a39a53d
basic tidyselect
nmdefries 0636d25
tidyselect can't be used to provide column names
nmdefries 7eebf51
Merge branch 'dev' into ndefries/opt-slide-proper-tidyselect
nmdefries e227ccf
need to run eval_select after grouping to get correct column positions
nmdefries 0f0df7d
note use of colnames as character vector
nmdefries 7de0187
update epi_slide_mean/sum defaults
nmdefries 1db0a01
error messages refer to _opt
nmdefries d6ff281
run `eval_select` once and immediately convert `pos` into explicit
nmdefries e89d79a
update test error classes to match _mean -> _opt
nmdefries c91e4e6
update tests
nmdefries 7ed59b6
update examples
nmdefries a1effcd
style: styler (GHA)
nmdefries 63fd31d
news and version
nmdefries f4a72f0
Merge branch 'dev' into ndefries/opt-slide-proper-tidyselect
nmdefries 6c1524d
test renaming
nmdefries 1afd765
missing )
nmdefries de936f5
tidyselect options description
nmdefries 64658c1
build docs and link tidyselect page
nmdefries File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Type: Package | ||
Package: epiprocess | ||
Title: Tools for basic signal processing in epidemiology | ||
Version: 0.7.10 | ||
Version: 0.7.11 | ||
Authors@R: c( | ||
person("Jacob", "Bien", role = "ctb"), | ||
person("Logan", "Brooks", email = "[email protected]", role = c("aut", "cre")), | ||
|
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
musing: This also makes me wish for something like
new_col_name
that actually did what you'd naturally guess here (without requiringnames_sep = NULL
). Though I vaguely recall we were putting off coming up with a better interface here (especially regarding better prefixes/suffixes for means and sums)? Part of this was due to trying for consistency with whatepi_slide()
technically does, but currently I'm thinking a bit of technical inconsistency is fine. (And the solution to the inconsistency seems like it'd be removingas_list_col
andnames_sep
globally, supporting multiple tidyeval expressions, and mirroring dplyr support for things liketibble(x = 1) %>% mutate(tibble(y = x + 1, z = x + 2))
; that last one seems tricky but might be possible. Then we could make.new_col_name
or.new_col_names
or actually do what it sounds like since we'd never be automatically unnesting. I don't /think/ this loses out on functionality since the remaining use cast of nesting & unnesting I can think of --- hiding your true number of rows from epi_slide's number-of-row constraints --- you already have to do as_list_col = TRUE and unnest manually.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we fully supported multiple tidyeval expressions, would we need to have a .new_col_name param at all? The renaming functionality in tidyselect is sufficient if we don't do the unnesting step.
For the epi_slide_opt and derived fns, we are currently passing ... as args to the slide computation (frollmean, etc) so multiple tidy expressions might be an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
.new_col_name
would still be helpful/convenient for non-tidy-eval (function/formula)epi_slide
and forepi_slide_opt
.Regarding
...
as args: I don't think we've ever been able to actually use this feature in a useful way, so we could consider removing it if it's a problem. But I'm not sure it is. The major pain I was thinking of at least was detecting whetherf
is a tidyeval computation or not when we allow unnamed tidyeval computations. This seems potentially possible: in the first/each computation application, evaluatef
as if it were tidyeval, check if it actually results in a function or formula, and if so, adjust appropriately; if it results in a tibble, then it's the tidyeval onf
and each of...
; iff
is missing it's also tidyeval.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to #461