Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

threshrankfun

A closure version of the threshrank function.


Description

Takes the same arguments as threshrank, except for x, because the output is a single-argument function rather than a rank-transformed numeric. This is useful for higher-order functions that require a single-argument function as input, like transform_sample_counts.

Usage

threshrankfun(thresh, keep0s=FALSE, ...)

Arguments

thresh

A single numeric value giving the threshold.

keep0s

A logical determining whether 0's in x should remain a zero-value in the output. If FALSE, zeros are treated as any other value.

...

Further arguments passes to the rank function.

Value

A single-argument function with the options to threshrank set.

See Also

Examples

data(esophagus)
x1 = transform_sample_counts(esophagus, threshrankfun(50))
otu_table(x1)
x2 = transform_sample_counts(esophagus, rank)
otu_table(x2)
identical(x1, x2)

phyloseq

Handling and analysis of high-throughput microbiome census data

v1.34.0
AGPL-3
Authors
Paul J. McMurdie <joey711@gmail.com>, Susan Holmes <susan@stat.stanford.edu>, with contributions from Gregory Jordan and Scott Chamberlain
Initial release
2019-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.