https://github.com/cran/SoDA
Revision 1c016a1d9d1dc7690f7c256204f737661d261cb0 authored by jmc on 20 September 2007, 00:00:00 UTC, committed by Gabor Csardi on 20 September 2007, 00:00:00 UTC
0 parent
Raw File
Tip revision: 1c016a1d9d1dc7690f7c256204f737661d261cb0 authored by jmc on 20 September 2007, 00:00:00 UTC
version 0.96
Tip revision: 1c016a1
dropFormula.R
dropFormula <- function(original, drop) {
    factors <- attr(terms(as.formula(original)),
                    "factors")
    row <-  match(drop, rownames(factors))
    whichTerms <- factors[row,] == 1
    labels <- colnames(factors)[whichTerms]
    text <- paste("~ . ",
                  paste("-", labels, collapse = " "))
    eval(parse(text = text))
}
back to top