Skip to content
Prev 206030 / 398506 Next

Getting a date out of an indice in a time series

You cannot faithfully map year and week to ts since years do not have
the same number of weeks and ts can only represent regular series. If
you wish to use ts for this and you want it to be faithful then use
ts(x) and 1 will represent the first week, 2 the second, etc.  Then if
o is a Date class variable representing the origin and idx is an index
then o + 7 * idx or that shifted appropriately depending on where you
put the origin is the Date in question.   If you are willing to go
beyond ts you could look at the tis package which provides facilities
for mapping to various regular series.  tis does have facilities for
mapping to ts.  Alternately if you are willing to represent your
series as an irregular series you could look at the zoo package.  zoo
also has facilities for mapping to ts.
 but using different assumptions.
On Mon, Jan 11, 2010 at 2:34 PM, Idgarad <idgarad at gmail.com> wrote: