This function removes objects from an environment that were added after a recorded initial state. Optionally filters by pattern.
remove_new_globals(env, initial_state, patterns = NULL, dry_run = FALSE)Invisibly returns a character vector of removed object names.
Environment to clean.
Character vector of object names before setup.
Optional regex patterns to filter objects.
Logical. If TRUE, only prints what would be removed.