Displaying 1 result from an estimated 1 matches for "lzero".
Did you mean:
zero
2005 Aug 03
1
passing variable to formula environment
...1.92, 3, 5.83, 3.17, 15.5, 1.17, 5.58,
13.33, 14.29, 5.83, 13.79, 6.33, 13.75, 16.83, 13, 11.67, 0.25, 1.73,
9.46, 5.67), length = c(157, 165, 179, 171, 195, 135, 179, 193, 194,
186, 196, 186, 210, 200, 189, 194, 106, 161, 188, 159))
# return gompertz fit
Gompertz <- function(data,Xintercept,Lzero,start) {
gomp <- formula(length ~ Lzero * exp(k * (1 - exp(-g * (age -
Xintercept)))))
nls(formula=gomp,data=data,start=start)
}
When I run the function, I get the following error:
> Gompertz(growth,0,87,list(k=0.5,g=0.5))
Error in eval(expr, envir, enclos) : Object "Lzero"...