Skip to contents

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_match is TRUE. By default, it removes QC flag variables.

exact_match

An indicator to apply exact matching method. By default exact_match = TRUE, the variable name exc_col that match exactly in a given character vector will be removed. Otherwise, the name that matches the pattern exc_col will be removed.

Value

A character vector

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\\_"))
} # }