Skip to contents

This function is used to check if the provided column names are existed in the dataset.

Usage

check_colnames(.data, col_names, strict = FALSE, stop_message = TRUE)

Arguments

.data

Data.frame

col_names

Column names

strict

A Boolean value to apply strict checking.

stop_message

A Boolean value to return a stop message if the criteria does not met.

Value

  • TRUE if the provided column names are existed in the dataset based on the strict argument.

  • Otherwise list of column names that are not existed in the dataset or a stop message if stop_message is TRUE.

Examples

if (FALSE) { # \dontrun{
check_colnames(
  .data = ADNIMERGE2::CDR,
  col_names = c("Phase", "VISCODE"),
  strict = FALSE
)
check_colnames(
  .data = ADNIMERGE2::CDR,
  col_names = c("RID", "VISCODE"),
  strict = TRUE
)
} # }