ColSeeker {wrappedtools} | R Documentation |
Find numeric index and names of columns based on type and patterns
Description
ColSeeker
looks up colnames (by default for tibble rawdata)
based on type and parts of names, using regular expressions.
Be warned that special characters as e.g. [
(
need to be escaped or replaced by .
Exclusion rules may be specified as well.
Usage
ColSeeker(
data = rawdata,
namepattern = ".",
varclass = NULL,
exclude = NULL,
excludeclass = NULL,
casesensitive = TRUE,
returnclass = FALSE
)
Arguments
data |
tibble or data.frame, where columns are to be found; by default rawdata |
namepattern |
Vector of pattern to look for. |
varclass |
Vector, only columns of defined class(es) are returned |
exclude |
Vector of pattern to exclude from found names. |
excludeclass |
Vector, exclude columns of specified class(es) |
casesensitive |
Logical if case is respected in matching (default FALSE: a<>A) |
returnclass |
Logical if classes should be included in output |
Value
A list with index, names, and backticked names, optionally the classes as well
Examples
ColSeeker(data = mtcars, namepattern = c("^c", "g"))
ColSeeker(data = mtcars, namepattern = c("^c", "g"), exclude = "r")
[Package wrappedtools version 0.9.5 Index]