get.first.mode: Get First Peak

Description Usage Arguments Value Examples

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

Description

This function grabs the first peak or shoulder.

Usage

1
2
get.first.mode(x, y, rare.prop = 1/5, verbose = TRUE, remove.tail = TRUE,
  ...)

Arguments

x

values of midpoints from hist

y

values of counts from hist

rare.prop

Proportion used to remove rare intensity tail

verbose

print diagnostic output

remove.tail

Remove rare intensity tail

...

arguments to be passed to smooth_hist

Value

Value of x that is the first peak

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(t1.voi.hist)
system.time({
y = t1.voi.hist$counts
x = t1.voi.hist$mids
x = x[!is.na(y)];
y = y[!is.na(y)]
# 20 used for speed of example
nawm_peak = get.first.mode(x, y, k=20)
plot(t1.voi.hist, border="red")
abline(v=nawm_peak)
})
 

WhiteStripe documentation built on April 19, 2018, 1:04 a.m.