R/genZ2freq.R

genZ2freq <-
function (genZ) 
{
    s <- apply(genZ, 2, sum)
    if (ncol(genZ) == 3) {
        return(s/(sum(s)))
    }
    else {
        d <- NULL
        n <- log(ncol(genZ))/log(3)
        for (l in 1:n) {
            d <- c(d, sum(s[(3 * l - 2):(3 * l)]))
        }
        return(s/(rep(d, each = 3)))
    }
}

Try the noia package in your browser

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

noia documentation built on March 31, 2023, 6:45 p.m.