Last active
March 13, 2019 15:37
-
-
Save arnauldvm/ea1133b69e692ab92bab8335dc4b7961 to your computer and use it in GitHub Desktop.
R session cleanup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (sink.number()>0) sink(file=NULL) # Close all remaining files opened by a previous run | |
cat("All file descriptors closed.\n") | |
rm(list=ls()); gc() # Clean up as much memory as possible | |
# Replace by the following line if you want to keep getargs array to retrieve arguments: | |
# rm(list=grep("getargs", ls(), fixed=T, value=T, invert=T)); gc() | |
cat("Whole memory cleaned.\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment