tests/testthat/test-sample_mean.R

library(testthat)
library(data.summary)

context("Sample Mean")

test_that("Calculated Correctly", {

  x <- 1:10

  expect_equal(sample_mean(x), 5.5)

  y <- c( -3, 50, 5, -11, 4)

  expect_equal(sample_mean(y), 9)

  z <- rnorm(20)

  expect_equal(sample_mean(z), mean(z))

})
AshleyDennisHenderson/data.summary documentation built on June 12, 2019, 11:25 a.m.