tests/testthat/test-normalizeWeights.R

context("normalizeWeights")

test_that("normalizeWeights: use", {
  skip_on_cran()
  A <- rep(1,5)
  v <- normalizeWeights(A)
  expect_equal(
    sum(v),1
  )
  expect_equal(v[1],0.2)

  A <- c(A,1e6)
  v <- normalizeWeights(A)
  expect_equal(sum(v),1)
  expect_equal(v[6],1,tolerance=1e-4)
})

Try the STEPCAM package in your browser

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

STEPCAM documentation built on May 1, 2019, 10:11 p.m.