tests/testthat/setup.R

library(data.table)
origDTthreads <- getDTthreads()
if (!identical(Sys.getenv("NOT_CRAN"), "true")) { # this asks "is this test running on CRAN"
  Sys.setenv("OMP_THREAD_LIMIT" = 1)
  withr::defer(
    {
      data.table::setDTthreads(origDTthreads)
    },
    teardown_env()
  )
}
setDTthreads() # this triggers data.table to read the OMP_THREAD_LIMIT

Try the NetLogoR package in your browser

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

NetLogoR documentation built on May 29, 2024, 11:13 a.m.