tests/testthat/test_stat_density.R

library(ggdistribute)
context("Testing stat density computations")

set.seed(20130110)
x <- rnorm(1000, 100, 15)

test_that("List modification", {
  expect_named(compute_density(x), c(
    "x", "density", "scaled",
    "count", "n"
  ))

  defaults <- compute_conf_ints(x)

  expect_named(defaults, c("mid", "sdl", "sdu", "cil", "ciu"))
  expect_identical(defaults, compute_conf_ints(x, NA, NA, NA))
})

Try the ggdistribute package in your browser

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

ggdistribute documentation built on May 2, 2019, 10:25 a.m.