If you are on a unix system, you will most likely get access to a program called a screen.
If available, you can open a terminal, launch a screen, start R, and then close the terminal while R is still running in the background.
Then at a later time or the next day, you simply open another terminal and use the screen to connect to a previously created session.
Steps:
in your terminal, launch screen
screen
run R and run your program
Close the terminal, just press x, not ctrl-d.
... a few hours later
open a new terminal, enter
screen -ls
to get a list of current screen sessions
connect to your chosen session
screen -r 34234
source share