clear: Clear/reset an RStudio session

Description Usage Arguments Details Note Examples

View source: R/clear.R

Description

Clear/reset an RStudio session

Usage

1

Arguments

detach

logical. If TRUE, unload all but base packages.

Details

The clear() function:

  1. Clears the console window

  2. Deletes objects from the global environment

  3. Deletes plots and plot history from the Plots window

  4. Unloads all but base packages (unless detach=FALSE)

  5. Releases memory (garbage collection)

R scripts and Rmarkdown files are left untouched. No objects saved to disk are affected.

Note

This is a good way to start a fresh R session without having to quit and restart RStudio. Additionally, any script or Rmarkdown files remain open, the current working directory is unchanged, and you remain in any open project.

Examples

1
2
3
4
## Not run: 
clear()

## End(Not run)

Rkabacoff/qacr documentation built on March 20, 2021, 3:03 p.m.