Description Usage Arguments Value Examples
View source: R/kinMatrix2LongForm.R
Part of Group Formation
1 | kinMatrix2LongForm(kinMatrix, rm.dups = FALSE)
|
kinMatrix |
numerical matrix of pairwise kinship values. The row and column names correspond to animal IDs. |
rm.dups |
logical value indication whether or not reverse-order ID pairs be filtered out? (i.e., "ID1 ID2 kin_val" and "ID2 ID1 kin_val" will be collapsed into a single entry if rm.dups = TRUE) |
A dataframe with columns id1
, id2
, and kinship
.
This is the kinship data reformatted from a matrix, to a long-format table.
1 2 3 4 5 6 7 8 | library(nprcgenekeepr)
ped <- nprcgenekeepr::lacy1989Ped
ped$gen <- findGeneration(ped$id, ped$sire, ped$dam)
kmat <- kinship(ped$id, ped$sire, ped$dam, ped$gen)
reformattedKmat <- kinMatrix2LongForm(kmat, rm.dups = FALSE)
nrow(reformattedKmat)
reformattedNoDupsKmat <- kinMatrix2LongForm(kmat, rm.dups = TRUE)
nrow(reformattedNoDupsKmat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.