prev: Calculate prevalence from numeric vector

View source: R/heatmap-utils.R

prevR Documentation

Calculate prevalence from numeric vector

Description

Useful as helper for taxon prevalence calculation

Usage

prev(x, undetected = 0)

Arguments

x

numeric vector (of taxon counts or proportions)

undetected

value above which a taxon is considered present or detected

Value

numeric value

Examples

prev(c(0, 0, 1, 2, 4))
prev(c(0, 0, 1, 2, 4), undetected = 1.5)

david-barnett/microViz documentation built on April 17, 2025, 4:25 a.m.