# \donttest{
## A temperature response function
require(ggplot2)
set.seed(1234)
x <- 1:50
y <- temp3(x, 25, 13, 36) + rnorm(length(x), sd = 0.05)
dat1 <- data.frame(x = x, y = y)
fit1 <- nls(y ~ SStemp3(x, t.m, t.l, t.h), data = dat1)
ggplot(data = dat1, aes(x, y)) +
geom_point() +
geom_line(aes(y = fitted(fit1)))
# }
Run the code above in your browser using DataLab