[R] Help with "by"

David Winsemius dwinsemius at comcast.net
Sun Apr 5 00:10:06 CEST 2009


On Apr 4, 2009, at 3:42 PM, AllenL wrote:

>
> Searched for "by" in forums and no hits, should be simple problem.

The help page for by must surely have have *some* information?

>
>
> 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?

A) You are not providing an example that can be worked on.
B) You are not providing the output of your session.
C) You are not describing Data, Plot and AbvBioAnnProd.

Wild assed guess:
bio.mean <- by(Data$AbvBioAnnProd, Data$Plot, mean )

>

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list