Description Usage Arguments Value Examples

The kinship matrix *Φ^T* contains inbreeding coefficients *f_j^T* along the diagonal, present as *φ_jj^T = (1+f_j^T)/2*. This function extracts the vector of *f_j^T* values from the input *Φ^T*.

1 | ```
inbr(Phi)
``` |

`Phi` |
The |

The length-*n* vector of inbreeding coefficients *f_j^T* for each individual *j*.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
## Construct toy data
X <- matrix(c(0,1,2,1,0,1,1,0,2), nrow=3, byrow=TRUE) # genotype matrix
subpops <- c(1,1,2) # subpopulation assignments for individuals
## NOTE: for BED-formatted input, use BEDMatrix!
## "file" is path to BED file (excluding .bed extension)
# library(BEDMatrix)
# X <- BEDMatrix(file) # load genotype matrix object
## estimate the kinship matrix "Phi" from the genotypes "X"!
Phi <- popkin(X, subpops) # calculate kinship from X and optional subpop labels
## extract inbreeding coefficients from Phi
inbr <- inbr(Phi)
``` |

popkin documentation built on Jan. 27, 2018, 1:03 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.