util.test {CHNOSZ} | R Documentation |
Functions modelled after the expect_
functions in testthat.
maxdiff(x, y) expect_maxdiff(object, expected, maxdiff = 0)
x |
numeric object |
y |
numeric object |
object |
numeric, object to test |
expected |
numeric, expected value |
maxdiff |
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.