Description Usage Arguments Value Examples
View source: R/PeakFunctions_func_gaussian.R
Calculates either a normal distribution similar to dnorm() with an integrated area of 1 or a gaussian peak with amplitude k
1 | func_gaussian(x, mu, sigma, probDensity = TRUE, k)
|
x |
a vector of x-coordinates from which the corrisponding y-coordinates are calculated |
mu |
the mean |
sigma |
the standard deviation |
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. Only used when 'probDensity == FALSE' |
a vector of y-coordinates the same length as x
1 2 3 4 5 6 7 8 | #normal distribution
xVec <- seq(from = 1, to = 100, by = 0.1)
pdensity <- func_gaussian(x = xVec, mu = 10, sigma = 1, probDensity = TRUE)
p1 <- plot(x = xVec, y = pdensity)
#gaussian peak
gpeak <- func_gaussian(x = xVec, mu = 10, sigma = 1, probDensity = FALSE, k = 10)
p2 <- plot(x = xVec, y = gpeak)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.