Learn R Programming

manymodelr (version 0.3.2)

add_model_predictions: Add predictions to the data set. A dplyr compatible way to add predictions to a data set.

Description

Add predictions to the data set. A dplyr compatible way to add predictions to a data set.

Usage

add_model_predictions(model = NULL, old_data = NULL, new_data = NULL)

Arguments

model

A model object from `fit_model`

old_data

The data set to which predicted values will be added.

new_data

The data set to use for predicting.

Value

A data.frame object with a new column for predicted values

See Also

fit_model extract_model_info

Examples

Run this code
# NOT RUN {
iris1 <- iris[1:50,]
iris2 <- iris[51:100,]
lm_model <- fit_model(iris1,"Sepal.Length","Sepal.Width","lm") 
head(add_model_predictions(lm_model,iris1,iris2))
# }

Run the code above in your browser using DataLab