tests/testthat/test-plot.R

test_that("factor-information plots can be requested by term", {
  fit <- nparLD(
    resp ~ group1 * group2 * time,
    data = shoulder,
    subject = "subject",
    hypothesis = "H0p",
    Factor.Information = TRUE
  )

  p1 <- plot(fit, term = "time")
  p2 <- plot(fit, term = c("time", "group1:time"))

  expect_s3_class(p1, "ggplot")
  expect_s3_class(p2, "ggplot")
})

test_that("factor-information plot requires Factor.Information", {
  fit <- nparLD(
    resp ~ group1 * group2 * time,
    data = shoulder,
    subject = "subject",
    hypothesis = "H0p"
  )

  expect_error(
    plot(fit, term = "time"),
    "Factor.Information = TRUE"
  )
})

Try the nparLD package in your browser

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

nparLD documentation built on Aug. 28, 2026, 5:06 p.m.