Functions modelled after the expect_
functions in testthat.
maxdiff(x, y)
expect_maxdiff(object, expected, maxdiff = 0)
numeric object
numeric object
numeric, object to test
numeric, expected value
numeric, maximum pairwise difference between object and expected value
maxdiff
computes the maximum (absolute) pairwise difference between x and y, i.e. max(abs(y - x))
.
expect_maxdiff
tests that the maximum of the pairwise differences between two objects is less than the value of the argument maxdiff
.
The function uses expect
to generate an expectation in the testthat framework.