[R] time series missing 0 counts

Schnitzler, Johannes SchnitzlerJ at rki.de
Fri Feb 14 11:54:02 CET 2003


> Dear All.
> 
> The problem.
> 
> I have several large data sets with counts per week. 
> (Maximum week per year is 52. Counts from Week 53
> are added to week 52.) 
> 
> A data set contains for example:
> 
> Year	Week	Count
> 2000 	52	2
> 2001	1	5
> 2001	2	7
> 2001	5	4
> 2001	7	2
> ...	...	...
> ...	...	...
> 
> Weeks with 0 counts are not listed in the data set.
> I want to perform time series analysis (frequency 52).
> 
> 
> Is there an easy way to expand the data set to:
> 
> Year	Week	Count
> 2000	52	2
> 2001	1	5
> 2001	2	7
> 2001	3	0
> 2001	4	0
> 2001	5	4
> 2001	6	0
> 2001	7	2
> ...	...	...
> ...	...	...
> 
> or is there already a function in "ts", which i have not found so far,
> to deal with this problem?
> 
> 
> Thank you very much.
> 
> Johannes Schnitzler
> Germany Berlin
> 
>  
>




More information about the R-help mailing list