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

Add method to facilitate using dplyr::count on tax tables and sample data #73

Open
mikemc opened this issue Jun 23, 2021 · 0 comments
Open
Labels
enhancement New feature or request
Milestone

Comments

@mikemc
Copy link
Owner

mikemc commented Jun 23, 2021

Problem: Currently one needs to do

GlobalPatterns %>% sample_data %>% as("data.frame") %>% count(SampleType)

This isn't so bad, but it's annoying to have to always explicitly coerce to a data frame.

If we could define count() methods for sample_data and tax_table objects, then we could just omit that step. However, I haven't figured out how to define methods for S4 objects in a way that doesn't interfere with dplyr's functions (hence why we now have ps_tibble() instead of just as_tibble() methods). An alternative would be to go the route of the other dplyr verbs and define count_sample_data() and count_tax_table() functions.

ps %>% count_sample_data(SampleType)
@mikemc mikemc added the enhancement New feature or request label Jun 23, 2021
@mikemc mikemc added this to the v0.6 milestone Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant