| format_lddf | R Documentation |
mldest() or
sldest() into an
upper-triangular matrix.Formats the LD estimates and standard errors output
from running mldest() or sldest()
into a more conventional upper-triangular matrix.
format_lddf(obj, element = "r2")
obj |
An object of class |
element |
Which element in |
A matrix of the selected elements. Only the upper-triangle of the
matrix is filled. The lower-triangle and the diagonal are NA's.
David Gerard
set.seed(1)
## Simulate genotypes when true correlation is 0
nloci <- 5
nind <- 100
K <- 6
nc <- 1
genomat <- matrix(sample(0:K, nind * nloci, TRUE), nrow = nloci)
## Haplotypic LD estimates
lddf <- mldest(geno = genomat,
K = K,
nc = nc,
type = "hap")
## Obtain the D estimates in matrix form
Dmat <- format_lddf(obj = lddf, element = "D")
Dmat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.