I use the mice package to conduct imputation, but it takes a couple of hours to do, so I would really appreciate it, if I could store the resulting mids object and just load that in the future. I'm sorry if this is a really rookie sort of question. But I have tried simply using the base save and load functions, but it doesn't appear to be saving it correctly.
EDIT: I found out that it works if I load plainly. However, if I load into a new object, it won't be loaded as a mids-object. I have added the following minimum reproducable example.
x<-rnorm(10,14,2)
y<-rnorm(10,7,3)
z<-rnorm(10,18,5)
df<-data.frame(x,y,z)
df$x[sample(1:nrow(df), 0.2*nrow(df))] = NA
df$y[sample(1:nrow(df), 0.2*nrow(df))] = NA
df$z[sample(1:nrow(df), 0.2*nrow(df))] = NA
View(df)
imp <- mice(df, pred=quickpred(df))
save(imp, file = "impExample.rda")
rm(imp)
load("impExample.rda")
rm(imp)
impExample <- load("impExample.rda")