powered by
Check actual versus expected values and get helpful metrics back. Author: Bryce Chamberlain. Tech review: Lindsay Smeltzer.
checkeq(expected, actual, desc = "", acceptable_pct_diff = 1e-08, digits = 2)
Message (via cat) indicating success or errors out in case of failure.
The expected value of the metric.
The actual value of the metric.
(Optional) Description of the metric being checked.
(Optional) Acceptable percentage difference when checking values. Checked as an absolute value.
(Optional) Digits to round to. Without rounding you get errors from floating values. Set to NA to avoid rounding.
checkeq(expected=100,actual=100,desc='A Match')
Run the code above in your browser using DataLab