Description Usage Arguments Value Examples
View source: R/get.largest.mode.R
This function grabs the largest peak of the histogram
1 | get.largest.mode(x, y, verbose = TRUE, ...)
|
x |
values of midpoints from |
y |
values of counts from |
verbose |
print diagnostic output |
... |
arguments to be passed to |
Value of x that is the largest peak
1 2 3 4 5 6 7 8 9 10 11 | 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)
})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.