tests/testthat/helper-registry.R

# Redirect the sd2R model registry into a per-session temporary directory
# so that running the test suite (including R CMD check) never writes to
# the user's home directory, as required by the CRAN Policy.
local({
  reg_dir <- file.path(tempdir(), "sd2R-registry")
  dir.create(reg_dir, recursive = TRUE, showWarnings = FALSE)
  Sys.setenv(SD2R_REGISTRY_DIR = reg_dir)
})

Try the sd2R package in your browser

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

sd2R documentation built on June 19, 2026, 9:08 a.m.