View source: R/makeRelationsClassesTable.R
makeRelationClassesTable | R Documentation |
kin
dataframe.From Relations
makeRelationClassesTable(kin)
kin |
a dataframe with columns |
A data.frame with the number of instances of following relationship classes: Parent-Offspring, Full-Siblings, Half-Siblings, Grandparent-Grandchild, Full-Cousins, Cousin - Other, Full-Avuncular, Avuncular - Other, Other, and No Relation.
library(nprcgenekeepr)
suppressMessages(library(dplyr))
qcPed <- nprcgenekeepr::qcPed
bkmat <- kinship(qcPed$id, qcPed$sire, qcPed$dam, qcPed$gen,
sparse = FALSE)
kin <- convertRelationships(bkmat, qcPed)
relClasses <- makeRelationClassesTable(kin)
relClasses$`Relationship Class` <-
as.character(relClasses$`Relationship Class`)
relClassTbl <- kin[!kin$relation == "Self", ] %>%
group_by(relation) %>%
summarise(count = n())
relClassTbl
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.