tests/testthat/test_wtdVar.R

x <- c(50, 0, 25)
w <- c(1, 5, 1)
##saveRDS(Hmisc::wtd.var(x, w), "C:/Users/benjb/Documents/Repositories/eatTools/tests/testthat/helper_hmisc_wtdvar.RDS")

hmisc_wtdvar <- readRDS("helper_hmisc_wtdvar.RDS")

test_that("wtdvar implementation", {
  expect_equal(wtdVar(x, w), hmisc_wtdvar)
})

Try the eatTools package in your browser

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

eatTools documentation built on Nov. 23, 2023, 5:06 p.m.