tests/testthat/test-unit-rank.quantiles.R

context("rank.quantiles")

test_that("rank.quantiles is implemented correctly", {
  ranks <- matrix(c(1/4, 1/4, 1/4, 1/4, 1/2, 1/4, 1/4, 0, 1/4, 1/2, 1/4, 0, 0, 0, 1/4, 3/4), nrow=4, byrow=TRUE, dimnames=list(c("A", "B", "C", "D"), NULL))
  expect_equal(rank.quantiles(ranks), matrix(c(1,2,4,1,1,3,1,2,3,3,4,4), nrow=4, byrow=TRUE, dimnames=list(c("A", "B", "C", "D"), c("2.5%", "50%", "97.5%"))))
})

Try the gemtc package in your browser

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

gemtc documentation built on Aug. 21, 2026, 9:07 a.m.