declutter.envir: Delete temporary or test objects in 'ls()'

View source: R/declutter.envir.R

declutter.envirR Documentation

Delete temporary or test objects in 'ls()'

Description

This function deletes all items (object, function, ...) containing either 'tmp' or 'test' in the name. Also, if the name is only 1 letter long, it will be deleted

Usage

declutter.envir(extra_rules = "test", verbose = FALSE)

Arguments

extra_rules

A character that defines extra patterns to delete (eg: extra_rules = c("temp","delete")). NB: RegEx are also allowed

verbose

A logical whether you want the function to print the objects it removed

Examples


papaya <- "good"
first_attempt <- "eat"
second_attempt <- "digest"

declutter_Envir(extra_rules = c("papaya", "attempt"))

ls()
# you should only see digest

g-antonello/gautils2 documentation built on Nov. 28, 2022, 9:39 a.m.