Skip to contents

This awareness function helps you search the data dictionary for a specific term; intended for use as an investigative aid to supplement other checks in this package.

Usage

dictionary_search(
  DD.dict,
  search.term = c("blood pressure"),
  search.column = c("VARDESC")
)

Arguments

DD.dict

Data dictionary.

search.term

Search term.

search.column

Column of the data dictionary to search.

Value

Tibble containing dictionary rows in which the search term was detected in specified column or an error message if the search column could not be detected.

Examples

# Successful search
data(ExampleB)
dictionary_search(DD.dict.B, search.term=c("skinfold"), search.column=c("VARDESC"))
#> # A tibble: 2 × 21
#>   VARNAME VARDESC   DOCFILE TYPE  UNITS   MIN   MAX RESOLUTION COMMENT1 COMMENT2
#>   <chr>   <chr>     <lgl>   <chr> <chr> <dbl> <dbl> <lgl>      <lgl>    <lgl>   
#> 1 ABD_SKF Abdomina… NA      inte… mm       NA    NA NA         NA       NA      
#> 2 SUP_SKF Supraili… NA      inte… mm       NA    NA NA         NA       NA      
#> # ℹ 11 more variables: VARIABLE_SOURCE <lgl>, SOURCE_VARIABLE_ID <lgl>,
#> #   VARIABLE_MAPPING <lgl>, UNIQUEKEY <lgl>, COLLINTERVAL <lgl>, ORDER <lgl>,
#> #   VALUES <chr>, ...18 <chr>, ...19 <chr>, ...20 <chr>, ...21 <chr>
# Attempted search in wrong column
dictionary_search(DD.dict.B, search.term=c("skinfold"), search.column=c("VARIABLE_DESCRIPTION"))
#> [1] "ERROR: VARIABLE_DESCRIPTION is not a column name in the data dictionary."