[R] calculating means

David Winsemius dwinsemius at comcast.net
Fri Feb 18 18:20:47 CET 2011


On Feb 18, 2011, at 9:45 AM, Mike Gibson wrote:

>
> I apologize if you have already seen my question.  I am new to the  
> mailing list and I did not get any responses the first time I posted  
> my question.  However, I am not sure my post went through.

It didn't.
>
> Here is my situation:
> I have a spreadsheet with columns of fish species (text) and length  
> (numbers).  In the fish species column I have 5 different fish.  I  
> want R to calculate the mean length and standard error for each  
> species.
>
> I tried using the stats functin with
> stats(fishdata, by=species)
>
> R told me it could not find function stats.  Is there a library I  
> need to install to get stats to work?

"stats" is a rather fundamental package that is loaded by default when  
R starts up, while "mean" is a function in  the base package.

 > ?mean
 > help(package=stats)

It's possible that "stats" is also a function in some other package,  
but you have not told us why you think so. I can tell you that (at  
least) 5 different packages have a "describe" function and the base  
package has "summary".

 > RSiteSearch("stats")

Unfortunately that is not a productive answer to your questions, since  
it provides more than 1500 hits, not too surprising I suppose since  
this is a "stats" program.

And .... please pay careful attention to the list sig.
-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list