Description Usage Arguments Details Value Examples
Remove objects, which fulfill determined conditions
1 2 |
condition |
function or lambda expression (one side formula) |
pattern |
regex pattern to select a set of objects; default: NULL |
envir |
environment; default: caller environment |
verbose |
print removed objects' names |
Function can be used with envir = globalenv() argument.
NULL (function returns nothing)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | create_data <- function() data.frame(a = 1:10, b = 11:20)
x <- cars
y <- 1:20
z <- function(x) x +2
l <- list(1,2,3,4)
erase_if(is.list)
ls()
# You may use lambda expression
create_data <- function() data.frame(a = 1:10, b = 11:20)
x <- cars
y <- 1:20
z <- function(x) x +2
l <- list(1,2,3,4)
erase_if(~ is.function(.x) | is.data.frame(.x))
ls()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.