Learn R Programming

hierfstat (version 0.5-11)

kinship2grm: Converts a kinship matrix to a Genetic Relation Matrix (GRM)

Description

Converts a kinship matrix to a Genetic Relation Matrix (GRM)

Usage

kinship2grm(x)

Arguments

x

a square matrix containing kinship coefficients

Value

a GRM matrix

Details

for off-diagonal elements, \(GRM=2 \times x_{ij}\); for diagonal elements, \(GRM=1+ x_{ii}\)

Examples

Run this code
# NOT RUN {
dos<-matrix(sample(0:2,replace=TRUE,size=1000),nrow=10) #dosage matrix for 10 inds at 100 loci
ks<-beta.dosage(dos) # kinship matrix
kinship2grm(ks)
# }

Run the code above in your browser using DataLab