Skip to content
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

increase tidyeval usage #178

Merged
merged 3 commits into from
Feb 10, 2018
Merged

increase tidyeval usage #178

merged 3 commits into from
Feb 10, 2018

Conversation

bfgray3
Copy link
Contributor

@bfgray3 bfgray3 commented Feb 9, 2018

this is a replacement for #146. sorry for the confusion in that pull request.

@sfirke sfirke mentioned this pull request Feb 9, 2018
20 tasks
@codecov
Copy link

codecov bot commented Feb 9, 2018

Codecov Report

Merging #178 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #178   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          20     20           
  Lines         601    600    -1     
=====================================
- Hits          601    600    -1
Impacted Files Coverage Δ
R/adorn_percentages.R 100% <100%> (ø) ⬆️
R/tabyl.R 100% <100%> (ø) ⬆️
R/adorn_pct_formatting.R 100% <100%> (ø) ⬆️
R/adorn_totals.R 100% <100%> (ø) ⬆️
R/top_levels.R 100% <100%> (ø) ⬆️
R/get_dupes.R 100% <100%> (ø) ⬆️
R/adorn_ns.R 100% <100%> (ø) ⬆️
R/adorn_title.R 100% <100%> (ø) ⬆️
R/adorn_rounding.R 100% <100%> (ø) ⬆️

@sfirke
Copy link
Owner

sfirke commented Feb 9, 2018

Just taking a quick look, I think this is even better than the rebase. It looks like you used the current dev version of these functions as the base for your changes so it should be easily mergeable.

I'll try to review this within the next week. I see changes like switching from deprecated count_ to count() with tidyeval - that is great!

Copy link
Owner

@sfirke sfirke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I think I understand why they are all superior replacements. Had not seen quos_auto_name() before and in particular appreciate the refactoring of get_dupes.

R/tabyl.R Outdated
combos <- tidyr::complete(tabl %>% dplyr::select(-n), !!!rlang::syms(names(tabl)[1:2])) # this is pretty ugly - using dplyr keeps col types the same making for easier join, vs. expand.grid
# would be nice to just complete() tabl and skip the join, but couldn't get the eval to work
tabl <- suppressMessages(dplyr::full_join(tabl, combos))
tabl <- tidyr::complete(tabl, !! var1, !! var2)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bfgray3 I don't remember all of my struggles originally with this but my comment indicates that this was a kludge but the best I could do. I seem to have succeeded in simplifying this as I'd originally hoped... it passes the tests so should be good but do you see any risks here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Definitely much better than the update I had made. 👍

@sfirke sfirke merged commit f95d319 into sfirke:master Feb 10, 2018
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.

2 participants