check_key() accepts a data frame and, optionally, columns.
It throws an error
if the specified columns are NOT a unique key of the data frame.
If the columns given in the ellipsis ARE a key, the data frame itself is returned silently, so that it can be used for piping.
The data frame whose columns should be tested for key properties.
The names of the columns to be checked.
One or more unquoted expressions separated by commas. Variable names can be treated as if they were positions, so you can use expressions like x:y to select ranges of variables.
The arguments in ... are automatically quoted and evaluated in a context where column names represent column positions. They also support unquoting and splicing. See vignette("programming") for an introduction to these concepts.
See select helpers for more details and examples about tidyselect helpers such as starts_with(), everything(), ...
.data, invisibly, if the check is passed.
Otherwise an error is thrown and the reason for it is explained.