| kin2deg | R Documentation | 
Converts a vector of kinship coefficients to "degrees of relationship", as used by some software for relatedness inference (e.g. KING).
kin2deg(kin, unrelated = Inf)
| kin | A vector of kinship coefficients, i.e., numbers in  | 
| unrelated | The conversion of unrelated individuals ( | 
The implementation uses the conversion formula
deg = round(-log2(kin) -
1).
The first degrees correspond to the following approximate kinship ranges:
[0.354, 1]: 0th degree (MZ twins or duplicates)
[0.177, 0.354): 1st degree (parent-offspring, full siblings)
[0.0884, 0.177): 2nd degree (half sibs, grandparent-grandchild, avuncular)
[0.0442, 0.0884) 3rd degree (half-avuncular, first cousins, great-grandparent etc)
An integer vector of the same length as kin.
KING manual with thresholds for relationship degrees: https://www.kingrelatedness.com/manual.shtml
kinship(), coeffTable()
x = cousinPed(1)
# Kinship matrix
k = kinship(x)
# Degrees
deg = kin2deg(k)
deg
# First cousins are 3rd degree
stopifnot(deg['7', '8'] == 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.