tests/testthat/test-353-allocationTable-Functionality.R

context("Allocation Table Functionality")

test_that("allocation table can be generated",{
  expect_silent(
    allocationTable(rcon, 
                    random = "treatment", 
                    replicates = 8,
                    block.size = 8,
                    seed.dev = 10,
                    seed.prod = 20,
                    weights = c(Control = 1, Treatment = 1))
  )
})


test_that("allocation table can be updated offline",{
  
  filename <- tempfile()
  on.exit(unlink(filename))
  
  meta_data20 <- exportMetaData(rcon)
  write.csv(meta_data20, filename, na = "", row.names = FALSE)
  
  expect_silent(
    allocationTable_offline(filename,
                            random = "treatment", 
                            replicates = 8,
                            block.size = 8,
                            seed.dev = 10,
                            seed.prod = 20,
                            weights = c(Control = 1, Treatment = 1))
  )
})

Try the redcapAPI package in your browser

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

redcapAPI documentation built on Sept. 13, 2023, 1:07 a.m.