assert_colnames.Rd
Provides a clearer error message in the case of missing variable.
assert_colnames(df, x, null_ok = TRUE)
(data.frame
)
(vector of character
) the names of the columns to be checked.
(logical
) can x
be NULL.
if (FALSE) {
assert_colnames(mtcars, c("speed", "seats"), null_ok = TRUE)
my_colnames <- NULL
assert_colnames(mtcars, my_colnames, null_ok = FALSE)
}