View source: R/pkg_field_check.R
| pkg_field_check | R Documentation | 
This function checks for additional fields required by this package including variable type (TYPE), minimum value (MIN), and maximum value (MAX).
pkg_field_check(DD.dict, DS.data, verbose = TRUE)
| DD.dict | Data dictionary. | 
| DS.data | Data set. | 
| verbose | When TRUE, the function prints the Message out, as well as a list of the fields not found in the data dictionary. | 
Even though MIN, MAX, and TYPE are not required by dbGaP, our package was created to use these variables in a series of other checks and awareness functions (e.g., render_report, values_check, etc.). If this function fails, the add_missing_fields function can be used.
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 TYPE, MIN, and MAX).
add_missing_fields
# Example 1: Fail check
data(ExampleD)
pkg_field_check(DD.dict.D, DS.data.D)
# Use the add_missing_fields function to add in data
DD.dict.updated <- add_missing_fields(DD.dict.D, DS.data.D)
# Be sure to call in the new version of the dictionary (DD.dict.updated)
pkg_field_check(DD.dict.updated, DS.data.D) 
# Example 2: Pass check
data(ExampleA)
pkg_field_check(DD.dict.A, DS.data.A)
print(pkg_field_check(DD.dict.A, DS.data.A, verbose=FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.