View source: R/deconvolve_fff.R
deconvolve_fff | R Documentation |
Deconvolve incompletely resolved peaks
deconvolve_fff(
x,
y,
h,
mu,
s,
g = NULL,
fn = "skew_gaussian",
algorithm = "port",
iter = 300,
tol = 0.1
)
x |
A vector of retention times. |
y |
A vector of detector responses. |
h |
A vector of guesses for peak height, with length equal to the desired number of peaks. |
mu |
A vector of guesses for peak means, with length equal to the desired number of peaks. |
s |
A vector of guesses for peak standard deviations, with length equal to the desired number of peaks. |
g |
A vector of guesses for peak shape parameters, with length equal to the desired number of peaks. Silently
ignored if |
fn |
Function for peak fitting: Gaussian, skew Gaussian or exponentially modified Gaussian ("normal", "skew_gaussian" or "emg"). |
algorithm |
Refer to nls() in the 'stats' package. |
iter |
Refer to nls() in the 'stats' package. |
tol |
Refer to nls() in the 'stats' package. |
A list containing the nls() model, the fitted model evaluated at x, and a tibble with a column for each of the component peaks evaluated at x.
set.seed(0)
x <- seq(0, 10, length.out = 100)
# two gaussian peaks:
y <- exp(-(x - 3) ^ 2 / 2) + exp(-(x - 7) ^ 2 / 2) + rnorm(100, 0, .1)
deconvolve_fff(x, y, h = c(1, 1), mu = c(3, 7), s = c(1, 1), fn = "normal")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.