tests/testthat/test_1-2-0_mean_na.R

context("mean_na")

test_that("mean na", {
  expect_equal(mean_na(1:5), 0)
  expect_equal(mean_na(NA), 1)
  expect_equal(mean_na(c(1:4, NA)), 0.2)
})

Try the hutils package in your browser

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

hutils documentation built on April 13, 2022, 5:23 p.m.