Check if a data set is valid given a Data Resource
dp_check_dataresource(
x,
dataresource = attr(x, "resource"),
constraints = TRUE,
throw = FALSE,
tolerance = sqrt(.Machine$double.eps)
)
Returns TRUE
when the field is valid. Returns a character vector with
length >= 1 if the field is not valid. The text in the character values
indicates why the field is not valid.
When throw = TRUE
the function will generate an error instead of
returning a character vector. When the dataset is valid the function returns
TRUE
invisibly.
data.frame
to check
dataresource
object to check x
against.
also check relevant constraints in the field descriptor.
generate an error if the data set is not valid according to the dataresource.
numerical tolerance used in some of the tests
Use isTRUE
to check if the test was successful.
See dp_check_field
for a function that checks a column or vector.