get.largest.mode: Grab largest peak

View source: R/get.largest.mode.R

get.largest.modeR Documentation

Grab largest peak

Description

This function grabs the largest peak of the histogram

Usage

get.largest.mode(x, y, verbose = TRUE, ...)

Arguments

x

values of midpoints from hist

y

values of counts from hist

verbose

print diagnostic output

...

arguments to be passed to smooth_hist

Value

Value of x that is the largest peak

Examples

data(t2.voi.hist)
system.time({
y = t2.voi.hist$counts
x = t2.voi.hist$mids
x = x[!is.na(y)];
y = y[!is.na(y)]
# 30 used for speed of example
nawm_peak = get.largest.mode(x, y, k=30)
plot(t2.voi.hist, border="red")
abline(v=nawm_peak)
})

WhiteStripe documentation built on Aug. 30, 2022, 9:06 a.m.