Nothing
test_that("get_element", {
x <- list(ab = "test", b = NULL, c = NA, d = vector())
expect_equal(
get_element(x, "ab"),
"test"
)
expect_equal(
get_element(x, "b"),
NULL
)
expect_equal(
get_element(x, "c"),
NA
)
expect_equal(
get_element(x, "d"),
vector()
)
expect_error(
get_element(x, "a"),
"named element does not exist"
)
expect_error(
get_element(x, 1),
"'name' must be a character string"
)
expect_equal(
get_element(x, "a", check_name = FALSE),
NULL
)
})
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.