tests/testthat/test-pattern.R

test_that("patterns", {

  set.seed(8)

  x <- as.matrix(abalone$x)
  y <- abalone$y

  lm_fit <- lm(y ~ as.matrix(x))

  g <- SLOPE(x, y, family = "gaussian", alpha = 1e-4, patterns = TRUE)

  pattern <- g[["patterns"]]

  expect_equal(nrow(pattern[[1]]), ncol(x))
})

Try the SLOPE package in your browser

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

SLOPE documentation built on July 2, 2025, 9:07 a.m.