This function is used to exclude QC flag variable names from a character vector.
Usage
exclude_cols(x, exc_col = c("has_qc_error", "qc_flag"), exact_match = TRUE)Arguments
- x
Character vector of QC flag variable names
- exc_col
Either a character vector or regex expressions of variable name that will be removed. It should be a character vector if
exact_matchisTRUE. By default, it removes QC flag variables.- exact_match
An indicator to apply exact matching method. By default
exact_match = TRUE, the variable nameexc_colthat match exactly in a given character vector will be removed. Otherwise, the name that matches the patternexc_colwill be removed.
Examples
if (FALSE) { # \dontrun{
x <- c("qc_flag", "CENTILOIDS")
# Exclude QC flag variables
## With exact match method
exclude_cols(x = x, exact_match = TRUE, exc_col = c("has_qc_error", "qc_flag"))
## With less restrict matching method
exclude_cols(x = x, exact_match = FALSE, exc_col = c("has\\_qc", "qc\\_"))
} # }
