Description Usage Arguments Value Examples
View source: R/add_sim_fiited.R
Add a column with the predicted data from a model
1 | add_sim_fitted(df, sim_obj, colname, scenario = NULL)
|
df |
A data frame |
sim_obj |
A 'sim' object derived from that frame |
colname |
A reference to the name of the new column - defaults to 'fitted' |
scenario |
A scenario for prediction. If NULL fits are based on original data |
The data frame with an extra column for the fitted value
1 2 3 | require(tidyverse)
eastmid_ttw %>% poisson_reg(From,To,Dist,Count) -> mdl
eastmid_ttw %>% add_sim_fitted(mdl)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.