erase: Remove (all) objects from environment

Description Usage Arguments Details Value Examples

View source: R/erase.R

Description

Remove (all) objects from environment

Usage

1
erase(pattern = NULL, envir = parent.frame(), verbose = FALSE)

Arguments

pattern

regex pattern to select a set of objects; default: NULL

envir

environment; default: caller environment

verbose

print removed objects' names

Details

Function can be used with envir = globalenv() argument.

Value

NULL (function returns nothing)

Examples

1
2
3
4
5
6
7
create_data <- function() data.frame(a = 1:10, b = 11:20)
x <- cars
y <- 1:20
z <- function(x) x +2
# Typically, we don't have to specify enironment
erase()
ls()

krzjoa/sponge documentation built on April 2, 2020, 1:49 p.m.