tests/testthat/test-Herfindahl.R

context("Herfindahl expectations")
pdf(NULL) # suppress generating any PDFs
test_that("Herfindahl", {
  dat = c(80, 60, 10, 20, 30)
  dat %>% Herfindahl %>% as.numeric %>%
    expect_equal(0.285, tolerance=.005)
})

Try the SciencesPo package in your browser

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

SciencesPo documentation built on May 29, 2017, 9:28 p.m.