checkColNames: Check that column names are found in a data frame

View source: R/checkColNames.R

checkColNamesR Documentation

Check that column names are found in a data frame

Description

Checks that all column names specified in "cols" are found in the data frame names (given by "dNames") and produces a neat error message if not

Usage

checkColNames(dNames, cols)

Arguments

dNames

Character vector of column names from a data frame

cols

Character vector of column names that should be found in the data frame

Value

A TRUE value (if all of "cols" are found in "dNames") or an exception if not

Author(s)

Romain Francois

Examples


	checkColNames(LETTERS, "D")
	checkColNames(LETTERS, LETTERS[1:5])
	## Not run: 
	  # Will show an error because "Hello" is not in LETTERS
	  checkColNames(LETTERS, c("A", "Hello"))
	
## End(Not run)


MikeKSmith/MSToolkit documentation built on Feb. 15, 2024, 5:32 p.m.