Skip to content

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

@mikemc

Description

@mikemc

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions