tests/test_asplit.R

source("helper/helper.R")

if (exists("asplit", envir = baseenv())) {
  f = get("asplit", envir = baseenv())
  expect_same = makeCompareFun(f, backports:::asplit)

  d <- 2 : 4
  x <- array(seq_len(prod(d)), d)
  expect_same(x, 2)
  expect_same(x, c(1, 2))
  x <- matrix(1 : 6, 2, 3)
  expect_same(x, 1)
}

Try the backports package in your browser

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

backports documentation built on June 24, 2024, 5:24 p.m.