[R] How to strip of a term in data.frame

From: Guojun Zhu <shmilylemon_at_yahoo.com>
Date: Wed 03 May 2006 - 14:47:01 EST

say I have 100 terms for data.frame a. I want to do a linear regression of one term (say y) on other 33 terms. the only way to write this is "lm(y~., data=a)". But there are some intermediate term on a and I need to take them off before I can run it. I know you can use a[,-(3:4)], But can I specify it by name instead, I want to save everything in a script, something by name is much easier to read and easier to maintain later.

also, how to take of some rows from data.frame. For example every row year==1995 or something like that?

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 Received on Wed May 03 14:51:35 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 03 May 2006 - 16:10:01 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.