test_that("Equality within a vector", {
expect_true(isEqual(c(1, 1, 1)))
expect_false(isEqual(c(1, 1, 1.1)))
expect_error(isEqual(LETTERS), "A numeric vector is expected.")
})
test_that("Positive numbers", {
expect_true(isPositive(c(1, 1, 1), strict = FALSE, na.rm = TRUE))
expect_false(isPositive(c(-1, 1, 1), strict = FALSE, na.rm = TRUE))
expect_true(isPositive(c(0, 1, 1), strict = FALSE, na.rm = TRUE))
expect_false(isPositive(c(0, 1, 1), strict = TRUE, na.rm = TRUE))
expect_true(is.na(isPositive(c(NA, 1, 1), strict = FALSE, na.rm = FALSE)))
expect_error(isPositive(LETTERS), "A numeric vector is expected.")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.