filterPairs: Filters kinship values from a long-format kinship table based...

View source: R/filterPairs.R

filterPairsR 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 id1, id2, and kinship. This is the kinship data reformatted from a matrix, to a long-format table.

ped

Dataframe of pedigree information including the IDs listed in candidates.

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 list(c("F", "F")).

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", ]

rmsharp/nprcmanager documentation built on Feb. 2, 2025, 12:45 a.m.