[R] summing values according to a factor

Salvatore Enrico Indiogine hindiogine at gmail.com
Mon May 7 21:59:06 CEST 2007


Dear Andy and all others who have replied:


On 07/05/07, Liaw, Andy <andy_liaw a merck.com> wrote:
> I guess what you want to do is compare Q1/T1 among the sections?  If you
> want to compute the sum of Q1/T1 by Section, you can do something like:
>
> sum.by.section <- with(mydata, tapply(Q1/T1, section, sum))
>
> Substitute sum with anything you want to compute.

That worked perfectly.   Thanks!

Enrico


-- 
Enrico Indiogine

Mathematics Education
Texas A&M University
hindiogine a gmail.com



More information about the R-help mailing list