filterPairs {nprcgenekeepr} | R Documentation |
Filters kinship values from a long-format kinship table based on the sexes of the two animals involved.
Description
Part of Group Formation
Usage
filterPairs(kin, ped, ignore = list(c("F", "F")))
Arguments
kin |
a dataframe with columns |
ped |
Dataframe of pedigree information including the IDs listed in
|
ignore |
a list containing zero or more character vectors of length 2
indicating which sex pairs should be ignored with regard to kinship.
Defaults to |
Value
A dataframe representing a filtered long-format kinship table.
Examples
library(nprcgenekeepr)
ped <- nprcgenekeepr::lacy1989Ped
ped$gen <- findGeneration(ped$id, ped$sire, ped$dam)
kmat <- kinship(ped$id, ped$sire, ped$dam, ped$gen)
kin <- kinMatrix2LongForm(kmat, removeDups = FALSE)
threshold <- 0.1
kin <- filterThreshold(kin, threshold = threshold)
ped$sex <- c("M", "F", "M", "M", "F", "F", "M")
kinNull <- filterPairs(kin, ped, ignore = NULL)
kinMM <- filterPairs(kin, ped, ignore = list(c("M", "M")))
ped
kin[kin$id1 == "C", ]
kinMM[kinMM$id1 == "C", ]
[Package nprcgenekeepr version 1.0.7 Index]