[R] ts vs. POSIX

Achim Zeileis zeileis at ci.tuwien.ac.at
Wed Oct 29 01:11:55 CET 2003


On Wednesday 29 October 2003 00:28, Erin Hodgess wrote:

> OK.
>
> What if I have a time series which is collected every Monday,
> please?
>
> What is the proper way to use the start option within the ts command
> in order to indicate that this is Monday data, please?

In ts you can just generate regularly spaced time series. As the help 
page states "start" is either a single number or a vector of two 
integers (tyipically years and months or something similar).

So to indiciate that you have monday data you have to store this 
meta-information in the name of the ts object or the man page, for 
example.

An alternative is to use irregularly spaced time series as provided by 
irts() in package tseries or its() in package its. Then you always 
store a full vector of POSIXct times at which the observations were 
made. Both approaches have certain advantages and 
disadvantages...depends on what you want to do with the data.

hth,
Z

> Thanks again!
>
> Sincerely,
> Erin
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list