[R] Creating quarterly data

From: Thomas Jensen <thomas.jensen_at_eup.gess.ethz.ch>
Date: Mon, 28 Jun 2010 14:23:09 +0200


Dear R Experts,

I have data in the following format

x1	x2	time
2	4	1
3	1	2
4	6	3
1	4	4	
5	6	5	
8	5	6

. . .
. . .
. . .
1 5 399 3 4 400

Time represents each month which simply has a number from 1 to 400 (i.e. the data covers 400 months). I would like to somehow create two new variables which counts x1 and x2 as quarterly data in stead of monthly. Like this:

x1	x1	Quarter
10	12	1
12	15	2

. . .
. . .
. . .
23 21 100

Can any one tell me how this can be done in R?

With kind regards,
Thomas Jensen



R-help_at_r-project.org 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. Received on Mon 28 Jun 2010 - 15:22:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Jun 2010 - 16:30:43 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive