check_data_entry | R Documentation |
Compares two numeric vectors. For numbers that differ by a single digit, returns the "depth" of this digit from the end of the number (i.e. 1.234 vs. 1.334 would have a depth of 3). Identical numbers return 0, and numbers that differ by more than one digit return NA.
check_data_entry(x1, x2, nsmall)
x1, x2 |
two numeric vecors. |
nsmall |
number of digits to the right of decimal point that numbers are formatted to. |
A clue that a data entry mistake has occurred is if two numbers are identical at all digits except for a single digit. This clue is stronger if the digit is towards the middle of the number, as the chance of two random numbers being identical at many subsequent digits is small. This function can be used to flag these values which can then be checked by hand more easily.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.