[R] Help with "by"

Uwe Ligges ligges at statistik.tu-dortmund.de
Sat Apr 4 23:36:08 CEST 2009



AllenL wrote:
> Searched for "by" in forums and no hits, should be simple problem.
> 
> This is my line:
>> bio.mean<-by(Data,Plot, function(x) mean(AbvBioAnnProd))
> 
> I want to calculate the mean of "AbvBioAnnProd" in each Plot. What am I
> doing wrong?

What is AbvBioAnnProd? I only see that you pass Data, Plot and the parts 
  of Data subscripted by Plot as x into the anonymous function, but 
there is no AbvBioAnnProd that mean can use so far ...
You need to tell us why R should know anything about that object.

Uwe Ligges



> 
> Thanks in advance,
> -AL
>



More information about the R-help mailing list