View source: R/Functions_extract_EICs.R
peakFitter | R Documentation |
fit a curve into a numeric vector. Will recursively try different starting values for the optimizer.
peakFitter( x, y, m, s, startdepth = 1, maxdepth = 5, best_estimate = 0, allowWorseScore = F )
x |
numeric vector to use as inout for fit function (typically series of scan numbers or retention time values) |
y |
numeric vector to fit the curve, same length as x |
m |
numeric value of the expected/initial position of the peak apex (in range of x) |
s |
numeric value of the expected/initial peak width. Should not be 0! |
startdepth |
defaults to 1, part of limiting the recursion |
maxdepth |
limits recursion to trying to fit curve |
best_estimate |
Best estimate from previous iterations - argument carries previous results through recursion |
allowWorseScore |
if FALSE, recursion ends when an iteration has a worse result than the previous one, and will return the best result up to that point |
Elements in returned list:
depth
integer indicationg recursion depth
fit
result of using nls()
on x
with
peakFunction()
, followed by fitted()
cor
result of calling cor.test()
on y
and fit
a list, see details
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.