Skip to content

Instantly share code, notes, and snippets.

@MilesMcBain
Created September 16, 2016 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MilesMcBain/be5b29fc0b823014e548945619130e7c to your computer and use it in GitHub Desktop.
Save MilesMcBain/be5b29fc0b823014e548945619130e7c to your computer and use it in GitHub Desktop.
#Remove things in the global environment with name like a string you supply.
#Like is in the regex match sense, so if you make a slip blowing away most of your environment is possibility.
rm_like <- function(pattern = character()) {
rm( list = grep(pattern = pattern,
x=ls(envir = globalenv()),
value = TRUE),
envir = globalenv()
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment