tests/testthat/test-missing.R

test_that("missing values handled", {
  expect_true(  is.na(d_pal(NA))) %>% expect_message()
  expect_equal(d_pal(c(NA, 1)), c(NA,        "#4B0055"))
  expect_equal(d_pal(c(NA, 1, 10)), c(NA,        "#4B0055", "#FDE333"))

})

Try the palr package in your browser

Any scripts or data that you put into this service are public.

palr documentation built on Nov. 6, 2023, 9:06 a.m.