Re: [R] Using "mean"  if two values are identical Hi,

> I've got a matrix (mail end) with the colnames x, y, z. In this matrix
> are different measurements. x and y are risign coordinates.
>
> My question. Always, if the "x" AND "y" coordinates are the same, I want to 
> get the mean of their z values.

Maybe you could try with the aggregate function, for example  :

aggregate(INPUT[,3], by=list(INPUT[,1],INPUT[,2]), FUN=mean)

Hope that helps,
-- 
Julien Barnier
Groupe de recherche sur la socialisation
ENS-LSH - Lyon, France

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

