Nothing
context("count_nas")
test_that("count_nas behaves as expected", {
expect_error(count_nas(rep(NA, 3)), "Input must be")
### Test a column of all NAs
df.nrows <- 10
df <- data.frame(x = rep(NA, df.nrows), y = runif(df.nrows))
expect_equal(count_nas(df), nrow(df))
### Test no missing values
df <- data.frame(x = rnorm(df.nrows), y = runif(df.nrows))
expect_equal(count_nas(df), 0)
### Add some missing values at the bottom
df[df.nrows + 1, ] <- c(NA, 1)
df[df.nrows + 2, ] <- c(NA, NA)
expect_equal(count_nas(df), 3)
})
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.