Re: [R] how to read data from table based a condition

From: Marc Moragues <>
Date: Thu, 10 Apr 2008 09:18:42 +0000 (UTC)

Xin <jasonshi510 <at>> writes:

> y<-data[,7]
> x<-data[,3]
> I want to know the mean of y if corresponding x=1.

Try this:


You can also look at ?subset. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 10 Apr 2008 - 09:22:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 Apr 2008 - 10:30:27 GMT.

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

list of date sections of archive