Daniel Gerlanc
2006-Jul-26 19:04 UTC
[R] How to split the left and right hand terms of a formula
Hello All, I've sent a few messages to the list regarding splitting a formula into its right and left hand terms. Thanks to everyone who has responded. I believe that the best way to extract the left and right hand terms as character vectors follows: library(nlme) formula <- y ~ x + z left.term <- all.vars(getResponseFormula(formula)) covariates <- all.vars(getCovariateFormula(formula)) Thanks! Dan Gerlanc Williams College