context("unit test for drop_rows_with_na")
test_that("drop_rows_with_na fails when given invalid input arguments", {
# No input arguments
expect_error(drop_rows_with_na())
})
test_that("drop_rows_with_na remove na as specified in the table profile", {
mtcars_profile <- generate_table_profile(.data = mtcars)
expect_identical(drop_rows_with_na(mtcars, mtcars_profile), mtcars)
set.seed(2048)
mtcars_with_na <- .insert_na_at_random(mtcars)
expect_identical(
drop_rows_with_na(mtcars_with_na, mtcars_profile),
mtcars_with_na[complete.cases(mtcars_with_na),]
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.