tests/testthat/test_metadata.R

library(typeless)

context("metadata")

test_that("nas function", {

  # data.frame with no NAs in the 1st column, one NA in the 2nd and none in the 3rd column
  ls_nas <- nas(data.frame(none = 10:8, one = c(1, 2, NA), two = c("a", NA, NA)))

  # checking each column individually
  expect_equal(ls_nas[[1]], 0)
  expect_equal(ls_nas[[2]], 1)
  expect_equal(ls_nas[[3]], 2)
})
ShaulAb/typeless documentation built on May 28, 2019, 3:15 p.m.