Learn R Programming

fritools (version 3.3.0)

wipe_clean: Remove All Objects From an Environment

Description

Wipe an environment, typically .GlobalEnv, clean.

Usage

wipe_clean(environment = getOption("wipe_clean_environment"), all_names = TRUE)

Arguments

environment

The environment that should be wiped clean. Defaults to .GlobalEnv.

all_names

See argument all.names for ls.

Value

A character vector containing the names of objects removed, but called for its side effect of removing all objects from the environment.

See Also

Other R memory functions: memory_hogs()

Examples

Run this code
# NOT RUN {
an_object <- 1
wipe_clean()
ls()
e <- new.env()
assign("a", 1, envir = e)
assign("b", 1, envir = e)
ls(envir = e)
wipe_clean(envir = e)
ls(envir = e)
RUnit::checkIdentical(length(ls(envir = e)), 0L)
# }

Run the code above in your browser using DataLab