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
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
Examples
checkColNames(LETTERS, "D")
#> [1] TRUE
checkColNames(LETTERS, LETTERS[1:5])
#> [1] TRUE
if (FALSE) {
# Will show an error because "Hello" is not in LETTERS
checkColNames(LETTERS, c("A", "Hello"))
}