tests/testthat/test_getParents.R

#' Copyright(c) 2017-2024 R. Mark Sharp
#' This file is part of nprcgenekeepr
context("getParents")
library(testthat)
data("smallPed")
ped <- smallPed
parents <- getParents(ped, "D")
test_that("getParents correctly returns correct IDs", {
  parents <- getParents(ped, "D")
  expect_true(all(parents %in% c("A", "B")))
  expect_true(all(c("A", "B") %in% parents))
  parents <- getParents(ped, c("D", "A"))
  expect_true(all(parents %in% c("A", "B", "Q")))
  expect_true(all(c("A", "B", "Q") %in% parents))
})

Try the nprcgenekeepr package in your browser

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

nprcgenekeepr documentation built on June 8, 2025, 10:55 a.m.