find_Peaks: A simple peak finding algorithm for ESR spectra

Description Usage Arguments Details Value Author(s) Examples

View source: R/find_peaks.R

Description

This is a simple algorithm to determine local minima and maxima of ESR spectra, but can also be used for various other kind of data.

Usage

1
find_Peaks(x, interval, th = 10)

Arguments

x

data.frame (required): a two column data.frame

interval

numeric: a vector of length two specifying the range of x-values where peaks are searched

th

numeric: an integer specifying the number of neighbouring values to compare each x-value to

Details

The algorithm characterises a peak by comparing the y-value at each x-value to its neighbouring y-values. The threshold value specified by th determines to how many neighbours the value is compared to, so that lower values of th yield more peaks than higher threshold values.

Value

A data.frame containing the x- and y-values of each peak is returned.

Author(s)

Christoph Burow, University of Cologne (Germany)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Import Bruker ELEXSYS500 spectrum (ASCII)
file <- system.file("extdata", "dpph.ASC", package = "ESR")
spec <- read_Spectrum(file)

# Use the function
peaks1 <- find_Peaks(spec)

# Since spec is an object of class ESR.Spectrum, you can also use
# its get-method
peaks2 <- spec$get_peaks()

identical(peaks1, peaks2)

tzerk/ESR documentation built on May 20, 2019, 1:12 p.m.