Best Software for 2025 is now live!

Can we save our process if we don't save a project?

If I don't save a project while running a whole script, can I save my results instead of starting it all over again after restart my computer? R seems to have no memory.
2 comments
Looks like you’re not logged in.
Users need to be logged in to answer questions
Log In
BG
Scientist
0
Yes, you can save either your whole environment or specific objects as .RDS files. RDS files contain one or more R objects. This is very helpful, if you only wish to save intermediate results. For saving RDS objects use saveRDS(). For reloading them use readRDS(). The exact use can be found in the widely available discussions and documentations online. I use it to store large tables that that if read directly from csv-format would take longer to load. Another use for me is storing prediction models that take hours to train.
Looks like you’re not logged in.
Users need to be logged in to write comments
Log In
Reply
Sean L.
SL
0
There are many ways to save results as an R script runs, take a look at the R saveRDS function as one example. For questions like this about R a great place to go is community.rstudio.com.
Looks like you’re not logged in.
Users need to be logged in to write comments
Log In
Reply