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

Description Usage Arguments Value See Also Examples

View source: R/add_model_predictions.R View source: R/add_model_predictions.R

Description

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

Usage

1
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

1
2
3
4
5
data("yields", package="manymodelr")
yields1 <- yields[1:50,]
yields2<- yields[51:100,]
lm_model <- fit_model(yields1,"weight","height","lm") 
head(add_model_predictions(lm_model,yields1,yields2))

manymodelr documentation built on Nov. 15, 2021, 5:07 p.m.