View source: R/mutate-auc_trapezoid.R
| auc_trapezoid | R Documentation |
Method trapezoid
auc_trapezoid(..., time = NULL, na.rm = FALSE)
... |
value |
time |
time |
na.rm |
na.rm |
vector
dat <-
data.frame(
t0 = c(1, 1, 1),
t2 = c(1, 2, 3),
t3 = c(1, 3, 5),
t4 = c(1, 3, 6)
)
#apply(dat, 1, function(x)
# sum(diff(time) * zoo::rollmean(x, 2)))
time = c(0, 1, 2, 3)
auc_trapezoid(1,1,1,1)
auc_trapezoid(dat )
transform(dat, auc= auc_trapezoid( t0, t2, t3, t4, time= time))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.