Description Usage Arguments Value Examples
View source: R/PeakFunctions_func_lorentzian.R
Calculate Cauchy (Lorentz) probability density function or a Lorentzian Peak
1 | func_lorentzian(x, x0, gamma, probDensity = TRUE, k)
|
x |
a vector of x-coordinates from which the corrisponding y-coordinates are calculated |
x0 |
location parameter specifying the location of the peak of the distribution |
gamma |
scale parameter specifying the half-width at half-maximum (HWHM) |
probDensity |
Should the function produce a probability density function 'TRUE' or a gaussian peak 'FALSE' with amplitude k? default is 'TRUE'. |
k |
amplitude of the peak at location x0 |
a vector of y-coordinates the same length as x
1 2 3 4 5 6 7 | #Probability density function
xVec <- seq(from = 1, to = 100, by = 0.1)
pdist <- func_lorentzian(x = xVec, x0 = 50, gamma = 1, probDensity = TRUE)
plot(x = xVec, y = pdist)
#Make a peak
lpeak <- func_lorentzian(x = xVec, x0 = 50, gamma = 1, probDensity = FALSE, k = 10)
plot(x = xVec, y = lpeak)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.