tests/testthat/test_ranktable.R

test_that("ranktable tests", {

    x <- rrank()
    expect_output(print(x))
    expect_output(print(summary(x)))

    expect_true(all(as.ranktable(as.ordertable(x)) == x))


    a <- skating_table
    o <- as.ordertable(unclass(a)[order(rownames(a)),])
    expect_true(all(as.ordertable(as.ranktable(o)) == o))
    


    expect_silent(ordertable_to_ranktable(pentathlon_table))

    x <- cbind(c(a=3, b=1, c=2), 1:3)
    colnames(x) <- c("j1", "j2")
    x <-  as.ordertable(x)
    y <- as.ranktable(x)
    expect_true(all(unclass(y) == letters[c(2,1,3,2,1,3)]))

    expect_true(suppfun(pentathlon_table) == pentathlon)
    
} )

Try the hyper2 package in your browser

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

hyper2 documentation built on June 23, 2026, 5:07 p.m.