f_clear | R Documentation |
Provides a convenient way to clear different components of the R environment, including the console, memory, graphics, and more. It also offers the option to restart the R session. This can come in handy at the start of an R script.
f_clear(env = TRUE, gc = TRUE, console = TRUE, graph = TRUE, restart = FALSE)
env |
Logical. If |
gc |
Logical. If |
console |
Logical. If |
graph |
Logical. If |
restart |
Logical. If |
Console Clearing: Clears the console output.
Garbage Collection: Performs garbage collection to free memory from unreferenced objects.
Graph Clearing: Closes all open graphics devices.
Environment Clearing: Removes all objects from the global environment.
Session Restart: Restarts the R session (only available in 'RStudio').
No return value, called for side effects, see details.
The restart
parameter requires 'RStudio' and its API package ('rstudioapi') to be installed and available.
Sander H. van Delden plantmind@proton.me
# Clear console, memory, graphs, and for example NOT the environment.
f_clear(env = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.