tests/testthat/test-Gini.R

context("Gini expectations")
pdf(NULL) # suppress generating any PDFs
test_that("Gini", {
  dat = c(1000, 2000, 3000, 4000, 5000)
  dat %>% Gini %>% as.numeric %>%
    expect_equal(0.2667, 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.