Description Usage Arguments Details Value Examples
Return TRUE or FALSE on whether or not each variable in a data.table complies with the HEIMS code limits
1 2 3 4 5 | validate_elements(DT, .progress_cat = FALSE)
prop_elements_valid(DT, char = FALSE)
count_elements_invalid(DT, char = FALSE)
|
DT |
The data.table whose variables are to be validated. |
.progress_cat |
Should the progress of the function be displayed on the console? If |
char |
Return as character vector, in particular marking – any complete or completely absent values. |
For early detection of invalid results, the type of the variable (in particular integer vs double) is considered first,
vetoing a TRUE
result if different.
A named logical vector, whether or not the variable complies with the style requirements. A value of NA
indicates the variable
was not checked (perhaps because it is absent from heims_data_dict
).
1 2 3 4 5 | X <- data.frame(E306 = c(0, 1011, 999, 9998))
validate_elements(X) # FALSE
prop_elements_valid(X)
X <- data.frame(E306 = as.integer(c(0, 1011, 999, 9998)))
validate_elements(X) # TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.