Learn R Programming

Kmisc (version 0.2.0)

without.re: Remove Variables from a List / Data Frame, with Regular Expressions

Description

Remove variables from a list / data.frame, whereby the variables not matching pattern are returned.

Usage

without.re(dat, pattern, value = TRUE, perl = TRUE, ...)

Arguments

dat
list or data.frame object, or other similar object with a names attribute
pattern
a regular expression pattern to match against names(dat)
value
boolean. passed to grep
perl
boolean. use perl-compatible regular expressions?
...
optional arguments passed to grep.

See Also

grep regex