tests/testthat/test-mpm_standardize.R

test_that("mpm_standardize works correctly", {
  # mpm with inter-reproductive stage
  repro_stages <- apply(mat_f_inter, 2, function(x) any(x > 0))
  matrix_stages <- c("prop", "active", "active", "active", "active")

  x1 <- mpm_standardize(mat_u_inter, mat_f_inter,
    repro_stages = repro_stages,
    matrix_stages = matrix_stages
  )

  expect_type(x1, "list")
  expect_length(x1, 4)
  expect_identical(ncol(x1$matA), 4L)

  x2 <- mpm_standardise(mat_u_inter, mat_f_inter,
    repro_stages = repro_stages,
    matrix_stages = matrix_stages
  )
  expect_identical(x1, x2) # check aliasing to GB spelling
})

Try the Rage package in your browser

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

Rage documentation built on April 4, 2025, 12:51 a.m.