speedyseq
speedyseq copied to clipboard
Give message/warning when subset_*() functions drop items due to NAs
(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
.