Skip to contents

This function checks for dbGaP required fields variable name (VARNAME), variable description (VARDESC), units (UNITS), and variable value and meaning (VALUES).

Usage

field_check(DD.dict, verbose = TRUE)

Arguments

DD.dict

Data dictionary.

verbose

When TRUE, the function prints the Message out, as well as a list of the fields not found in the data dictionary.

Value

Tibble, returned invisibly, containing: (1) Time (Time stamp); (2) Name (Name of the function); (3) Status (Passed/Failed); (4) Message (A copy of the message the function printed out); (5) Information (Named vector of TRUE/FALSE values alerting user if checks passed (TRUE) or failed (FALSE) for VARNAME, VARDESC, UNITS, and VALUE).

Examples

data(ExampleA)
field_check(DD.dict.A)
#> $Message
#> [1] "Passed: required fields VARNAME, VARDESC, UNITS, and VALUES present in the data dictionary."
#> 
print(field_check(DD.dict.A, verbose=FALSE))
#> # A tibble: 1 × 5
#>   Time                Function    Status Message                     Information
#>   <dttm>              <chr>       <chr>  <chr>                       <named lis>
#> 1 2023-09-27 11:01:16 field_check Passed Passed: required fields VA… <lgl [4]>