View source: R/transform_filter-methods.R
topp | R Documentation |
p
fraction of taxaMake filter fun. that returns the most abundant p
fraction of taxa
topp(p, na.rm=TRUE)
p |
A numeric of length 1, indicating what fraction of the most abundant taxa should be kept. |
na.rm |
A logical. Should |
A function (enclosure), suitable for filterfun_sample
,
that will return TRUE
for each element in the most abundant p fraction of taxa.
topk
, topf
,
topp
, rm_outlierf
## Use simulated abundance matrix set.seed(711) testOTU <- otu_table(matrix(sample(1:50, 25, replace=TRUE), 5, 5), taxa_are_rows=FALSE) sample_sums(testOTU) f1 <- filterfun_sample(topp(0.2)) (wh1 <- genefilter_sample(testOTU, f1, A=1)) wh2 <- c(TRUE, TRUE, TRUE, FALSE, FALSE) prune_taxa(wh1, testOTU) prune_taxa(wh2, testOTU)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.