R/CohortDefinitionSet.R
checkAndFixCohortDefinitionSetDataTypes.Rd
This function checks a data.frame to verify it holds the expected format for a cohortDefinitionSet's data types and can optionally fix data types that do not match the specification.
checkAndFixCohortDefinitionSetDataTypes(
x,
fixDataTypes = TRUE,
emitWarning = FALSE
)
The cohortDefinitionSet data.frame to check
When TRUE, this function will attempt to fix the data types to match the specification. @seealso [createEmptyCohortDefinitionSet()].
When TRUE, this function will emit warning messages when problems are encountered.
Returns a list() of the following form:
list( dataTypesMatch = TRUE/FALSE, x = data.frame() )
dataTypesMatch == TRUE when the supplied data.frame x matches the cohortDefinitionSet specification's data types.
If fixDataTypes == TRUE, x will hold the original data from x with the data types corrected. Otherwise x will hold the original value passed to this function.