R/sizelist.R

Defines functions sizelist

Documented in sizelist

sizelist <- function(nfactor, interaction=FALSE)
{
    if (nfactor == 1 & interaction)
        stop("There is just one factor in the model. Two-way interactions can't be included.")
    
    terms <- LETTERS[1:nfactor]

    if (interaction) 
        for (i in 1:(nfactor - 1)) 
            for (j in 1:(nfactor - i)) 
                terms <- c(terms, paste0(terms[i], "*" , terms[i+j]))

    paste(terms, collapse="+")
}

Try the BDEsize package in your browser

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

BDEsize documentation built on Sept. 30, 2021, 1:06 a.m.