[R] Handling time-series-Data

Kunzler, Andreas a.kunzler at bzaek.de
Thu Sep 11 09:37:44 CEST 2008


Dear List,

I ran into some problems with time-series-Data. 

Imagine a data-structure where observations (x) of test attendants (i) are made a four times (q) a year (y). The data is orderd the following way:
I	y	q	x	
1	2006	1	1
1	2006	3	1
1	2006	4	1
1	2007	1	1
1	2007	2	1
1	2007	3	1
1	2007	4	1
2	2006	1	1
3	2007	1	1
3	2007	2	1

I am looking for a way to count the attendants that at least have attendend one time a year. In this case 2 persons, because i=2 has no observation in 2007.

I thought about creating a subset with the duplicate function. But I can't find a way to control (i) and (y).

subset(data, !duplicated(i[y]))

Thanx so much

Andreas Kunzler
____________________________
Bundeszahnärztekammer (BZÄK)
Chausseestraße 13
10115 Berlin

Tel.: 030 40005-113
Fax:  030 40005-119

E-Mail: a.kunzler at bzaek.de 



More information about the R-help mailing list