tests/testthat/test-genind2genpop.R

test_that("genind2genpop works with missing loci", {
  data(nancycats)
  p17 <- nancycats[pop = 17, loc = 3:4]
  p   <- genind2genpop(p17)
  expect_s4_class(p, "genpop")
  ptab <- tab(p, freq = TRUE)
  expect_equal(nrow(ptab), 1L)
  expect_equal(ncol(ptab), sum(nAll(p17)))
  expect_false(any(is.na(ptab)))

})

Try the adegenet package in your browser

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

adegenet documentation built on Feb. 16, 2023, 6 p.m.