tests/testthat/test-estimable.R

test_that("estimable() throws errors when it should", {

  conc <- c(0.0625, 0.125, 0.25, 0.5, 1)
  pfx <- c(1, 4, 4, 7, 8)/8

  mydat <- data.frame(dose=conc, pfx=pfx)

  mymat <- as.matrix(mydat)

  mydat1 <- mydat
  names(mydat1)[1] <- "bob"
  mydat2 <- mydat
  names(mydat2)[2] <- "dorothy"

  conc.dup <- conc[c(1, 1, 3:5)]
  mydatdup <- data.frame(dose=conc.dup, pfx=pfx)

  expect_that(estimable(mymat), throws_error())
  expect_that(estimable(mydat1), throws_error())
  expect_that(estimable(mydat2), throws_error())
  expect_that(estimable(mydatdup), throws_error())

})

Try the LW1949 package in your browser

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

LW1949 documentation built on May 2, 2019, 6:11 a.m.