Skip to contents

Fitting of a single spectral line by lineshape functions with variable parameters.

Usage

peakfit(
  x,
  profile = "voigt",
  wL = NULL,
  wG = NULL,
  A = NULL,
  wlgth.min = NULL,
  wlgth.max = NULL,
  id = NULL,
  max.iter = 200
)

Arguments

x

A data frame or tibble

profile

A character specifying the lineshape function to be used: "lorentzian", "gaussian" or "voigt"

wL

A numeric specifying the Lorentzian full width at half maximum (initial guess)

wG

A numeric specifying the Gaussian full width at half maximum (initial guess)

A

A numeric specifying the peak area (initial guess)

wlgth.min

A numeric specifying the lower bound of the wavelength subset

wlgth.max

A numeric specifying the upper bound of the wavelength subset

id

A character specifying the spectra id (optional)

max.iter

A numeric specifying the maximum number of iteration (200 by default)

Value

Fitted value and the estimated parameters along with the corresponding errors

Details

The function uses minpack.lm::nlsLM, which is based on the Levenberg-Marquardt algorithm for searching the minimum value of the square of the sum of the residuals.

Author

Christian L. Goueguel