gp <- gp_init()
# fit the model (skipped here)
# save the model
filename <- file.path(tempdir(), 'gp.rda')
gp_save(gp, filename)
# load the model and remove the file
gp <- gp_load(filename)
file.remove(filename)
Run the code above in your browser using DataLab