tests/testthat/test-disparity_through_time.R

test_that("disparity_through_time() works", {
  skip_if_not_installed("dispRity")

  crinoids <- as.data.frame(demo_data$wright$matrix[[1]][, 1:2])
  crinoids$time <- "before extinction"
  crinoids$time[demo_data$wright$subsets$after$elements] <- "after extinction"
  crinoids$time <- factor(crinoids$time)
  attach(crinoids)
  lifecycle::expect_deprecated({
    disp_plot <- disparity_through_time(
      time ~ V1 * V2, groups = time, aspect = c(2, 1),
      xlim = c(-.6, .6), ylim = c(-.5, .5),
      col.regions = "lightgreen", col.point = c("red", "blue")
    )
  })
  expect_true(is(disp_plot, "trellis"))
  expect_doppelganger_deeptime("disparity_through_time()", disp_plot)
})

Try the deeptime package in your browser

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

deeptime documentation built on July 10, 2026, 9:08 a.m.