Re: [R] Subset dataframe based on condition

From: Steve Miller <>
Date: Tue 18 Apr 2006 - 02:06:25 EST

How about trying a nested subset:

submydf = subset(subset(mydf, a > 1),b <= a)

Steve Miller

-----Original Message-----
[] On Behalf Of Sachin J Sent: Monday, April 17, 2006 10:38 AM
Subject: [R] Subset dataframe based on condition


  I am trying to extract subset of data from my original data frame based on some condition. For example : (mydf -original data frame, submydf - subset dada frame)    

>submydf = subset(mydf, a > 1 & b <= a),

  here column a contains values ranging from 0.01 to 100000. I want to extract only those matching condition 1 i.e a > . But when i execute this command it is not giving me appropriate result. The subset df - submydf contains rows with 0.01 also. Please help me to resolve this problem.    

  Thanks in advance.    


        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Tue Apr 18 02:10:16 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 Tue 18 Apr 2006 - 04:10:03 EST.

Mailing list information is available at Please read the posting guide before posting to the list.