env_clear
Clear R environment
Cleans up the R environment by removing objects, closing plots, detaching packages, and running garbage collection. Does not clear the console.
Usage
env_clear(keep = character())
Arguments
| Argument | Description |
|---|---|
keep
|
Character vector of object names to keep (default: empty) |
Returns
Invisibly returns NULL
Examples
# Clean everything
env_clear()
# Keep specific objects
env_clear(keep = c("config", "data"))
Source: R/env.R