Dear All:

    I imported a table into R. But I want to read a variable (y) from this table conditional on another variable (x=1) in the table.

y<-data[,7]
x<-data[,3]

I want to know the mean of y if corresponding x=1.

I tried 

if (x==1) y3<-y 

It does not work.

Anyone can give a help?

Thanks!


Xin
	[[alternative HTML version deleted]]

