Checks a data frame's rows, columns, classes and values and key.
check_data3( data, values = NULL, min_row = 1, max_row = max_nrow(), key = character(0), select = FALSE, data_name = substitute(data) )
data | The data frame to check. |
---|---|
values | A named list specifying the columns and their associated classes and values. |
min_row | A count of the minimum number of rows. |
max_row | A count of the maximum number of rows. |
key | A character vector of the column names representing the key. |
select | deprecated A flag indicating whether to if possible drop unnamed columns and reorder the remainder so that column names matches those in values. |
data_name | A string of the name of data. |
Throws an informative error or returns an invisible copy of data.
check_data3
enforces maximal constraints.
By default it requires data to have rows (and therefore columns).
It also does not allow NULLs in values and
requires column names in values to be unique.
In addition it also requires that data only includes the columns in values in
the same order.
For more permissive data checking see check_data1
and
check_data2
.