R/lowerTriSub.r

Defines functions lowerTriMatInd

Documented in lowerTriMatInd

#gene subindexes in a lower triangular matrix
lowerTriMatInd<- function(x, P){
    i1 <- ceiling(((P-1/2)-sqrt((P-1/2)^2 -2*x)))
    i2 <- P-(i1*P-i1*(i1+1)/2-x)
    return(list(i1,i2))
}

Try the ldstatsHD package in your browser

Any scripts or data that you put into this service are public.

ldstatsHD documentation built on Aug. 14, 2017, 5:06 p.m.