rm2: Remove Objects from a Specified Environment containing a...

View source: R/rm2.R

rm2R Documentation

Remove Objects from a Specified Environment containing a specified pattern

Description

remove object(s) matching a pattern from an environment. The arguments pos, envir and inherits are passed to remove. A prompt ask to confirm the removal of variables in case the pattern matches somethings the user wants to keep.

Usage

rm2(pattern, pos = -1, envir = NULL, inherits = FALSE)

Arguments

pattern

a regular expression. Only names matching pattern will be removed.

pos

where to do the removal. By default, uses the current environment.

envir

the environment to use.

inherits

should the enclosing frames of the environment be inspected?

Examples

## Not run: 
x <- letters
rm2("^x$")

## End(Not run)

salix-d/salixUtils documentation built on Aug. 14, 2024, 7:11 a.m.