Added basic translation of "find"

This commit is contained in:
Waldir Leoncio 2020-03-18 10:30:37 +01:00
parent ac05f90b87
commit 42ada1d34a
3 changed files with 28 additions and 0 deletions

View file

@ -143,4 +143,12 @@ test_that("isempty works as expected", {
expect_false(isempty(cat1))
expect_true(isempty(cat2))
expect_false(isempty(str1))
})
test_that("find works as expected", {
X <- matrix(c(1, 0, 2, 0, 1, 1, 0, 0, 4), 3, byrow=TRUE)
Y <- seq(1, 19, 2)
expect_equal(find(X), c(1, 5, 7, 8, 9))
expect_equal(find(!X), c(2, 3, 4, 6))
expect_equal(find(Y == 13), 7)
})