knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-figs/", cache.path = "README-cache/" )
library(ggrowth)
Load the dataset that comes with the package (for illustration, this includes data for 2 individuals).
data("ggrowthData") # load data growthData$ID = as.factor(growthData$ID)
Fit the gompertz model to the dataset
fit = fit_gompertz(growthData)
Make a plot of the predicted values
ggplot(fit, aes(Jday, predict, group=ID, color=ID)) + geom_line() + geom_point(aes(Jday, Weight)) + xlab("Time") + ylab("Predicted weight")
New data can be added in as a new data frame, or rbind() to the existing data frame. The format is
head(growthData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.