expect_almost_equal {StableEstim} | R Documentation |
Tests the approximate equality of 2 objects. Useful for running tests.
expect_almost_equal(x, y, tolExpect = 0.001)
x |
first object. |
y |
second object. |
tolExpect |
tolerance, default is 0.001. |
This function works with the expect_that
function from package
testhat
to test equality between 2 objects with a given
tolerance. It is used particularly for testing functions output. See the
CF examples in the Examples folder.
expect_that
,testthat
x <- 1.1
y <- 1.5
expect_almost_equal(x, y, 1) # passes
## expect_almost_equal(x, y, 0.3) # fails