Re: [R] obtain names of variables and data from glm object

2009-07-26 Thread Gabor Grothendieck
Try this: g <- glm(demand ~ Time, BOD, family = gaussian) all.vars(formula(g)) The result will be a character vector whose 1st component is the name of the response and whose subsequent components are the names of the predictor variables. On Sun, Jul 26, 2009 at 3:14 PM, Jacob Wegelin wrote: > S

[R] obtain names of variables and data from glm object

2009-07-26 Thread Jacob Wegelin
Suppose we have some glm object such as: myglm <- glm( y ~ x, data=DAT) Is there an elegant way--or the "right way" within the R way of thinking--to obtain the names of the response variable, the predictor variables, and the dataset, as character strings? For instance, suppose the "right way" wa