minmax_check {dbGaPCheckup}R Documentation

Mimimum and Maximum Values Check

Description

This function flags variables that have values exceeding the MIN or MAX listed in the data dictionary.

Usage

minmax_check(DD.dict, DS.data, verbose = TRUE, non.NA.missing.codes = NA)

Arguments

DD.dict

Data dictionary.

DS.data

Data set.

verbose

When TRUE, the function prints the Message out, as well as a list of variables that violate the listed MIN or MAX.

non.NA.missing.codes

A user-defined vector of numerical missing value codes (e.g., -9999).

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 (A list of variables that exceed the listed MIN or MAX values).

Examples

# Example 1
# Fail check (incorrectly flagging NA value codes -9999
# and -4444 as outside of the min max range)
data(ExampleA)
minmax_check(DD.dict.A, DS.data.A)
# View out of range values:
details <- minmax_check(DD.dict.A, DS.data.A)$Information
details[[1]]$OutOfRangeValues
# Attempt 2, specifying -9999 and -4444 as missing value
# codes so check works correctly
minmax_check(DD.dict.A, DS.data.A, non.NA.missing.codes=c(-9999, -4444))

# Example 2
data(ExampleI)
minmax_check(DD.dict.I, DS.data.I, non.NA.missing.codes=c(-9999, -4444))
# View out of range values:
details <- minmax_check(DD.dict.I, DS.data.I, non.NA.missing.codes=c(-9999, -4444))$Information
details[[1]]$OutOfRangeValues

[Package dbGaPCheckup version 1.1.0 Index]