I used gather_predictions() to add several predictions to my data frame. Later on, perhaps after doing some visualizations, I want to add a new model's predictions. I can't seem to figure out how to do this.
I tried using add_predictions() and gather_predictions() but they added entirely new columns when I just want to add additional rows.
library(tidyverse)
library(modelr)
#The 3 original models
mdisp = lm(mpg ~ disp, mtcars)
mcyl = lm(mpg ~ cyl, mtcars)
mhp = lm(mpg ~ hp, mtcars)
#I added them to the data frame.
mtcars_pred <- mtcars %>%
gather_predictions(mdisp, mcyl, mhp)
#New model I want to add.
m_all <- lm(mpg ~ hp + cyl + disp, mtcars)