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

Description Usage Arguments Value Examples

View source: R/filterPairs.R

Description

Part of Group Formation

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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, rm.dups = 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 April 24, 2021, 3:13 p.m.