[R] basic problem but can't solve it

Cody_Hamilton at Edwards.com Cody_Hamilton at Edwards.com
Tue May 22 19:14:35 CEST 2007


Benoit,

Try the aggregate() function.

-Cody

Cody Hamilton, PhD
Edwards Lifesciences



                                                                           
             "Benoit                                                       
             Chemineau"                                                    
             <benoitchemineau@                                          To 
             gmail.com>                r-help at stat.math.ethz.ch            
             Sent by:                                                   cc 
             r-help-bounces at st                                             
             at.math.ethz.ch                                       Subject 
                                       [R] basic problem but can't solve   
                                       it                                  
             05/22/2007 10:01                                              
             AM                                                            
                                                                           
                                                                           
                                                                           
                                                                           




Hello,
   I have a basic problem but i can't figure it out with the
table underneath. I would like to compute monthly averages.
   I would like to have the average measure for month #5 for the first
three rows (the same number in the first three lines) and the average
measure for month #6 for the last four rows ((the same number in the first
three lines) in a separate vesctor (let's call it 'result')
   I tried to use a "while" statement inside a "for" loop but it doesn't
seem to work.
   Can someone please help me with this ?

   Measure Month
   2.28 5
   14.04 5
   0.60 5
   0.21 6
   0.96 6
   0.75 6
   1.28 6

   Thank you !

             [[alternative HTML version deleted]]

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list