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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to