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

Give message/warning when subset_*() functions drop items due to NAs #35

Open
mikemc opened this issue Jul 1, 2020 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@mikemc
Copy link
Owner

mikemc commented Jul 1, 2020

(I think) subset_samples() and subset_taxa() will drop samples and taxa where the subsetting condition evaluates to NA. This is consistent with base R's subset() and dplyr's filter(), but is can be dangerous if the user is unaware. Mistakes seem especially likely when using subset_taxa(). For example, suppose you wanted to remove all ASVs classified as Chloroplast. You might try

ps.filt <- subset_taxa(ps, order != "Chloroplast")

but this would drop all taxa with order == "Chloroplast" as well as taxa where order is NA.

@mikemc mikemc added the enhancement New feature or request label Jul 1, 2020
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