## create a random genotype matrix
nSamples <- 10
mMarkers <- 100
X <- matrix(rbinom(n=100, size=2, prob=0.5), nrow=nSamples)
## compute the Genetric Relatedness Matrix
grm <- cor(X)
## write a Genetic Relatedness Matrix (GRM)
## NOTE: to following is not run here -- not writing any files in examples
#write_GRMBin(grm, n.snps=mMarkers, prefix="grm.out")
Run the code above in your browser using DataLab