I have 7 training models in total. All of them are created using caret::train function.
5 of them are generated with R in one laptop(Mac), while the other 2 are generated with R in another laptop(PC). I need to output a chart. Before that I need to use caret::resamples function to generate the result. That means I will need all 7 models in the same environment. Is there any code I can write to do that?
>Solution :
Actually, as of Axeman’s comment, you can use saveRDS(model, "model.rds") and model <- readRDS("model.rds"), but you don’t need to use .RData in order to use the .rds files. You can just add the lines of code in your scripts!
You can do so for each model in your environment:
saveRDS(model1, "model1.rds")
saveRDS(model2, "model2.rds")
and so on, then transport to another computer however you’d like, and read:
model1 <- readRDS("model1.rds")
model2 <- readRDS("model2.rds")