whichcol {ILSAmerge} | R Documentation |
Which column
Description
Retrieves column names and labels that matches a general expression via grepl.
Usage
whichcol(pattern, tibble, label = TRUE, ignore.case = TRUE, ...)
Arguments
pattern |
character string containing a regular expression
(or character string for |
tibble |
a tibble object. |
label |
a logical value indicating if pattern should be searched in
variable label, instead of variable name. Default is |
ignore.case |
if |
... |
Arguments passed on to
|
Value
A data frame.
Examples
# tibble generated by haven
input <- system.file("extdata/reds", package = "ILSAmerge")
x <- do.call(rbind,justload(inputdir = input,population = "BCGV1"))
x
whichcol("weight",x)