View source: R/parametric_fits.R
low.integrate | R Documentation |
Function to estimate the area under a curve given as x and y(x) values
low.integrate(x, y)
x |
Numeric vector of x values. |
y |
Numeric vector of y values with the same length as |
The function uses the the R internal function smooth.spline
.
Numeric value: Area under the smoothed spline.
smooth.spline
# Create random growth dataset
rnd.dataset <- rdm.data(d = 35, mu = 0.8, A = 5, label = 'Test1')
# Extract time and growth data for single sample
time <- rnd.dataset$time[1,]
data <- as.numeric(rnd.dataset$data[1,-(1:3)]) # Remove identifier columns
plot(time, data)
print(low.integrate(time, data))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.