View source: R/basefunctions.R
ColSeeker | R Documentation |
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.
ColSeeker(
data = rawdata,
namepattern = ".",
varclass = NULL,
exclude = NULL,
excludeclass = NULL,
casesensitive = TRUE,
returnclass = FALSE
)
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 |
A list with index, names, backticked names, and count; optionally the classes as well
ColSeeker(data = mtcars, namepattern = c("^c", "g"))
ColSeeker(data = mtcars, namepattern = c("^c", "g"), exclude = "r")
assign("rawdata", mtcars)
ColSeeker(namepattern = c("^c", "g"), varclass="numeric")
num_int_data <- data.frame(num1=rnorm(10), num2=runif(10), int1=1:10, int2=11:20)
ColSeeker(num_int_data, varclass="numeric") # integers are not found
ColSeeker(num_int_data, varclass=c("numeric","integer"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.