powered by
This function checks a vector of column names to ensure they are valid. It performs the following checks:
The column names must not be NULL.
NULL
The column names must not contain empty strings.
The column names must not contain NA values.
NA
The column names must be unique.
validate_column_names(names)
Returns TRUE if all checks pass. If any check fails, the function stops and returns an error message.
TRUE
A character vector of column names to validate.
validate_column_names(c("name", "age", "gender"))
Run the code above in your browser using DataLab