distmode: Compute the mode of a distribution

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Computes the mode (and “antimode”) of a distribution. It is not clear whether this is a generally useful statistic, but bedtools defined it, so we did for completeness.

Usage

1
distmode(x, anti = FALSE)

Arguments

x

The vector for which the mode is computed.

anti

Whether to return the value with the least representation, instead of the highest.

Details

There are methods for List subclasses and ordinary vectors/factors. The List methods are useful for aggregation.

Value

The value that is the most (or least) prevalent in the x.

Author(s)

Michael Lawrence

See Also

Not to be confused with the data mode of a vector.

bedtools_map for an example in the context of aggregation.

Examples

1
distmode(c(1L, 2L, 1L))

lawremi/HelloRanges documentation built on May 18, 2021, 4:29 p.m.