[R] selecting data from a data.frame?

Michael A. Miller mmiller3 at iupui.edu
Fri Jan 4 22:32:27 CET 2002


I know how to plot a subset of a data.frame by doing something
like 

 > plot( mydata$x[y>2] )

Is there a way to do something similar for an entire data.frame?
For example, I can do this something like

 > lm( x[y>2] ~ type[y>2], data=mydata )

but I'm a lazy typist, so I'd like to be able to do something
like 

 > lm( x ~ type, data=mydata[y>2] )

Is there a way to select rows from a data frame like that?

Mike
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list