Nothing
test_that("rounding works", {
vec <- c(0.1234, 1.234, 12.34, 1234)
expect_equal(adapt_round(vec), c('0.12', '1.23', '12.3', '1,234'))
})
test_that("non-numeric input gets error", {
vec <- c("0.1234", "1.234", "12.34", "1234")
expect_error(adapt_round(vec), regexp = "should be numeric")
})
test_that("all NA input is handled correctly", {
vec <- c(NA, NA)
expect_equal(adapt_round(vec), c("NA","NA"))
})
test_that("some NA input is handled correctly", {
vec <- c(NA, NA, .1234)
expect_equal(adapt_round(vec), c("NA","NA", "0.12"))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.