R/gl.unequal.R

gl.unequal <-
function (n = "number of levels", k = "numeric vector of sample sizes") 
{
    out <- numeric()
    for (i in 1:n) {
        out <- append(out, rep(i, length.out = k[i]))
    }
    return(factor(out))
}

Try the DTK package in your browser

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

DTK documentation built on May 1, 2019, 9:16 p.m.