R/makeContrasts.R

Defines functions makeContrasts

Documented in makeContrasts

makeContrasts <- function(factors, 
                          quali, 
                          quanti, 
                          posquanti)
{
  if(quali){#only quantitatives
    contrast <- lapply(factors,
                       function(x)diag(length(x))) 
  } else if(quanti){#only quantitatives
    contrast <- lapply(factors,
                       function(x)contr.poly(length(x)))                            
  } else {#hybrido
    contrast <- lapply(factors,
                       function(x)diag(length(x)))
    contrast[posquanti] <- lapply(factors[posquanti],
                                  function(x)contr.poly(length(x)))   
  }
  return(contrast)
}

Try the gexp package in your browser

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

gexp documentation built on July 9, 2023, 5:42 p.m.