Re: [R] subsets in data frame

From: Spencer Graves <spencer.graves_at_pdf.com>
Date: Wed 14 Jul 2004 - 13:28:20 EST

?tapply

The examples there seem to describe what you want. hope this helps. spencer graves

Laura Holt wrote:

> Hello R People:
>
> I have a data frame with 2 numeric variables and 1 factor.
>
> There are 3 levels of the factor.
>
> I would like to get sums/means/etc of the numeric variables with
> respect to the factor level.
>
> I tried "table" and "subset" but have not hit upon a solution.
>
> I thought maybe "apply" would be the answer but can't figure out how
> to break out by factor.
>
> Any suggestions would be most appreciated.
>
> Thanks yet again.
> R Version 1.9.1 for windows
> Sincerely,
> Laura Holt
> mailto: lauraholt_983@hotmail.com
>
>
> your life. http://lifeevents.msn.com
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 14 13:34:57 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:56 EST