Learn R Programming

eponge (version 0.1.0)

erase_functions: Remove (all) functions from environment

Description

Remove (all) functions from environment

Usage

erase_functions(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

Value

NULL (function returns nothing)

Details

Function can be used with envir = globalenv() argument. Be careful: uncontrolled use may cause undesired side effects.

Examples

Run this code
# NOT RUN {
create_data <- function() data.frame(a = 1:10, b = 11:20)
x <- cars
y <- 1:20
z <- function(x) x +2
erase_functions()
ls()
# }

Run the code above in your browser using DataLab