external_coefs | R Documentation |
Wrappers for functions in other packages or external programs.
kinship2_kinship(x, ids = NULL, Xchrom = FALSE)
kinship2_inbreeding(x, Xchrom = FALSE)
x |
A pedigree, in the form of a |
ids |
A integer vector of length 2. |
Xchrom |
A logical, indicating if the autosomal (default) or X-chromosomal coefficients should be computed. |
kinship2_kinship()
and kinship2_inbreeding()
both wrap
kinship2::kinship()
.
For kinship2_inbreeding()
, a numerical vector with inbreeding coefficients,
named with ID labels.
For kinship2_kinship()
, either a single numeric (if ids
is a pair of
pedigree members) or the whole kinship matrix, with the ID labels as
dimnames.
kinship2::kinship()
# A random pedigree with 7 individuals
p = randomPed(n = 7, seed = 123)
### Kinship matrix
# Autosomal: Check that ribd agrees with kinship2
stopifnot(identical(
kinship(p), # ribd
kinship2_kinship(p) # kinship2
))
# X chromosomal kinship
stopifnot(identical(
kinship(p, Xchrom = TRUE), # ribd
kinship2_kinship(p, Xchrom = TRUE) # kinship2
))
### Inbreeding coefficients
# Autosomal
stopifnot(identical(
inbreeding(p), # ribd
kinship2_inbreeding(p) # kinship2
))
# X chromosomal
stopifnot(identical(
inbreeding(p, Xchrom = TRUE), # ribd
kinship2_inbreeding(p, Xchrom = TRUE) # kinship2
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.