> x<-rep(1,10)
> y<-rep(c(1,2),c(5,5))
> z<-seq(1:10)
> ab<-data.frame(x,y,z)
> tapply(ab$z,ab$y,mean)
1 2 
3 8 


-------Original Message-------
From: Heberto Ghezzo <[EMAIL PROTECTED]>
Sent: 01/29/03 03:24 PM
To: r-help <[EMAIL PROTECTED]>
Subject: [R] problems with by()

so, how can I get the function(x) to be applied to each level
of the index variable y.

Actually I use my own function but the same happens, it is applied to all the data and 
there is no partition of the data acording to index

______________________________________________
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to