tests/testthat/helper-regression.R

# Shared helper for regression tests.
# testthat auto-sources `helper-*.R` before any test file.

make_regression_data <- function(n = 30, seed = 0) {
  set.seed(seed)
  x <- matrix(runif(n * 2), ncol = 2)
  colnames(x) <- c("x1", "x2")
  y <- x[, 1] + x[, 2] + rnorm(n, sd = 0.1)
  list(x = x, y = y)
}

Try the ppforest2 package in your browser

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

ppforest2 documentation built on July 21, 2026, 9:07 a.m.