Skip to content

Tidy slide #31

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

Merged
merged 5 commits into from
Jan 14, 2022
Merged

Tidy slide #31

merged 5 commits into from
Jan 14, 2022

Conversation

ryantibs
Copy link
Member

Implement a tidy eval version of sliding! Much more convenient, since we can do something like this:

x %>% 
  epi_slide(cases_7dav = mean(cases), n = 7)

instead of this:

x %>% 
  epi_slide(f = function(x, ...) mean(x$cases), n = 7,
            new_col_name = "cases_7dav")

Also, I refactored pct_change() and estimate_deriv() were refactored so that they just operate on vectors, rather than on epi_df objects, and they can be used inside epi_slide() fluidly. This all closes #18.

Separately, I also decided to go with the following naming scheme: any function which operates on an epi_df object starts with epi. This followed a suggestion of @earowang. So we now have:

  • epi_slide()
  • epi_cor()
  • epi_detect_outlr()

Working in R studio, a user can therefore type epi_, then tab, and they will readily see what functions the package offers to operate on epi_df objects.

Finally, I updated the landing page (index.md) to give an overview of what the package offers.

@ryantibs ryantibs merged commit b6efc2b into main Jan 14, 2022
@ryantibs ryantibs deleted the tidy-slide branch February 3, 2022 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider tidyselect in epi_slide()
1 participant