# \donttest{
require(ggplot2)
set.seed(123)
x <- 1:30
y <- quadp3xs(x, 5, 1.7, 20) + rnorm(30, 0, 0.6)
dat <- data.frame(x = x, y = y)
fit <- nls(y ~ SSquadp3xs(x, a, b, xs), data = dat)
## plot
ggplot(data = dat, aes(x = x, y = y)) +
geom_point() +
geom_line(aes(y = fitted(fit)))
# }
Run the code above in your browser using DataLab