| growthmodel | R Documentation |
This constructor method allows to create user-defined functions that can be used as parametric models describing time-dependent growth of organisms.
growthmodel(x, pnames = NULL)
x |
a function with arguments |
pnames |
character vector with the names of the model parameters. |
Package growthrates has a plug-in architecture allowing user-defined growth models of the following form:
identifier <- function(time, parms) {
... content of function here ...
return(as.matrix(data.frame(time=time, y=y)))
}
where time is a numeric vector and parms a named, non-nested
list of model parameters. The constructor function growthmodel
is used to attach the names of the parameters as an optional
attribute.
Other growth models:
grow_baranyi(),
grow_exponential(),
grow_gompertz2(),
grow_gompertz(),
grow_huang(),
grow_logistic(),
grow_richards(),
ode_genlogistic(),
ode_twostep()
test <- function(time, parms) {
with(as.list(parms), {
y <- (K * y0) / (y0 + (K - y0) * exp(-mumax * time)) + y_shift
return(as.matrix(data.frame(time=time, y=y)))
})
}
mygrowthmodel <- growthmodel(test, c("y0", "mumax", "K", "y_shift"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.