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

Guojun Zhu shmilylemon at yahoo.com
Wed May 3 06:47:01 CEST 2006


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?




More information about the R-help mailing list