Skip to content

Instantly share code, notes, and snippets.

@ncarchedi
Created November 10, 2013 22:59
Show Gist options
  • Save ncarchedi/7405078 to your computer and use it in GitHub Desktop.
Save ncarchedi/7405078 to your computer and use it in GitHub Desktop.
This short R script initiates a callback function called saveWork. Every time a valid R command is executed in the console, the user's workspace will be automatically saved to the usual .Rdata file in the current working directory. This is particularly useful if the user is concerned about losing his or her work due to computer or software insta…
saveWork <- function(...) {
save.image()
TRUE
}
addTaskCallback(saveWork, name="autoSave")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment