tests/testthat/test-syt2ballot.R

context("conversion to and from ballot sequence")

test_that("syt2ballot", {
  v <- c(1L,1L,2L,3L,2L,1L)
  syt <- ballot2syt(v)
  w <- syt2ballot(syt)
  expect_identical(v, w)
  expect_identical(syt, list(c(1L,2L,6L),c(3L,5L),4L))
})

Try the syt package in your browser

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

syt documentation built on Jan. 16, 2021, 5:19 p.m.