[R] converting to a language object

About this list Date view Thread view Subject view Author view Attachment view

From: Arnab mukherji (arnab@myrealbox.com)
Date: Sat 08 Feb 2003 - 13:13:03 EST


Message-id: <1044670383.b4de3ce0arnab@myrealbox.com>

Hi,

I have a query about the following:

CONTEXT:
if we define:

eq <- y ~ x1 + x2

then is.language(eq) returns true.
this works perfectly with commands such as
lm(eq,data=my.data)

THE PROBLEM:
Now I have a big data set with about 2000 independent variables. So I tried to automate this. I can pick off the names of the variables and insert a plus in between them and get a string. Thus I have

eq<- y ~ " x1 + x2 + ... +x2000"
or
eq<-"y ~ " x1 + x2 + ... +x2000"

from either case how can I typecast eq into a langugae object and get the lm command to work ?

Does anyone have any suggestions?

thanks

Arnab.

______________________________________________
R-help@stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:21 EST