R/bits2int.R

Defines functions .bits2int

.bits2int <-
function(x, l2levels){
    nfac <- length(l2levels)
    cumlevels<-c(0,cumsum(l2levels))+1
    intvec <- rep(0,nfac)
    for(i in 1:nfac){
        z <- x[cumlevels[i]:(cumlevels[i+1]-1)]
        intvec[i] <- polyn.eval(z, 2)
    }
    return(intvec)
}
solvsa/simrel documentation built on May 30, 2019, 6:27 a.m.