[R] How to "bin"/average" time points?

sachinthaka.abeywardana at allianz.com.au sachinthaka.abeywardana at allianz.com.au
Fri Nov 26 00:51:04 CET 2010


It would be something like this (might have to change the syntax a bit)

bin_ave=0;
while (i <lenth(time)){
	bin_ave[k]=mean(time(i:i+6));
	k=k+1;
	i=i+6;
}

if your data is in a table format replace time with mytable$time.

hope this helps,

Sachin
p.s. sorry about corporate notice

--- Please consider the environment before printing this email --- 

Allianz - Best General Insurance Company of the Year 2010*
Allianz - General Insurance Company of the Year 2009+ 

* Australian Banking and Finance Insurance Awards
+ Australia and New Zealand Insurance Industry Awards 

This email and any attachments has been sent by Allianz ...{{dropped:3}}



More information about the R-help mailing list