Skip to content
Prev 12127 / 398502 Next

extracting subset from a data frame

David White <dwhite at ling.ohio-state.edu> writes:
Use subset(). Something like:

        new.df <- subset(old.df, old.df$condition == "within range")

should so it. You may also use indexes:

        new.df <- old.df[old.df$condition == "within range",]

The last comma is important.

Mark


--
Mark Myatt


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._