Learn R Programming

datapackage (version 0.2.1)

dp_check_field: Check if a vector is valid given a field descriptor

Description

Check if a vector is valid given a field descriptor

Usage

dp_check_field(
  x,
  fielddescriptor,
  constraints = TRUE,
  tolerance = sqrt(.Machine$double.eps)
)

Value

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.

Arguments

x

vector to test

fielddescriptor

field descriptor to test the vector against

constraints

also check relevant constraints in the field descriptor.

tolerance

numerical tolerance used in some of the tests

See Also

Use isTRUE to check if the test was successful. See dp_check_dataresource for a function that checks a complete data set.