tests/testthat/test-fit-aze.R

test_that("plsRglm fits a simple logistic model on 'aze' dataset", {
  skip_on_cran()
  skip_on_ci()
  data(aze, package = "plsRglm")
  expect_true(is.data.frame(aze))
  expect_true(is.logical(aze$y) || all(aze$y %in% c(0,1)))
  # Fit with 1-2 components to keep it fast
  set.seed(123)
  fit <- plsRglm(y ~ ., data = aze, nt = 2, modele = "pls-glm-logistic",
                verbose = FALSE)
  expect_s3_class(fit, "plsRglmmodel")
  pr <- predict(fit, type = "response")
  expect_equal(length(pr), nrow(aze))
  expect_true(all(is.finite(pr)))
})

Try the plsRglm package in your browser

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

plsRglm documentation built on June 17, 2026, 5:06 p.m.