checkField: Check that a setting parameter has a matching data field
Description
Checks that a single parameter from the settings list matches a field value in a specified data set
Usage
checkField(fieldKey, settings, data)
Arguments
fieldKey
a list (like those provided by getSettingKeys()) defining the position of parameter in the settings object.
settings
The settings list used to generate a chart like eDISH()
data
A data frame to check for the specified field
Value
A list containing the results of the check following the format specified in validateSettings()[["checkList"]]
Details
This function compares settings with field values as part of the validateSettings() function. More specifically, the function checks whether the fieldKey in a settings object matches a column/field combination in "data". The function makes 2 major assumptions about the structure of the settings object. First, it assumes that the first value in fieldKey is "settingName_values" and there is a corresponding "settingName_col" setting that defines the column to search for field-level data. Second, it expects that the value specified by key/settings is a list, and that each value in the list is a field of the variable above.
# NOT RUN {testSettings<-generateSettings(standard="AdAM")
fields<-list("measure_values","TB")
safetyGraphics:::checkField(fieldKey=fields,settings=testSettings, data=adlbc)
# }