remove_new_globals: Remove New Globals from Environment Based on Initial Snapshot

View source: R/run_covr_modes.R

remove_new_globalsR Documentation

Remove New Globals from Environment Based on Initial Snapshot

Description

This function removes objects from an environment that were added after a recorded initial state. Optionally filters by pattern.

Usage

remove_new_globals(env, initial_state, patterns = NULL, dry_run = FALSE)

Arguments

env

Environment to clean.

initial_state

Character vector of object names before setup.

patterns

Optional regex patterns to filter objects.

dry_run

Logical. If TRUE, only prints what would be removed.

Value

Invisibly returns a character vector of removed object names.


test.assessr documentation built on March 3, 2026, 1:06 a.m.