tests/testthat/test-shannon.R

context("shannon")
library(breakaway)

test_that("shannon isn't crazy", {
  
  expect_equal(true_shannon(c(0.5, 0.5)), 
               log(2))
  
})

test_that("good_turing works", {
  
  expect_error(good_turing(c(0.2, 0.8)))
  expect_is(good_turing(apples), "alpha_estimate")
  
})

test_that("chao_shen works", {
  
  expect_error(chao_shen(c(0.2, 0.8)))
  expect_is(chao_shen(apples), "alpha_estimate")
  
})

Try the breakaway package in your browser

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

breakaway documentation built on Nov. 22, 2022, 5:08 p.m.