Skip to content

creation of an high frequency series

2 messages · Paul Gilbert, billycorg

#
(from R-help Digest, Vol 117, Issue 26)
For this problem
  z <- zooreg(rep(NA,390), start = start, end = end, frequency=390)

works, however, if your real problem is that you have time stamps, 
possibly not equally spaced, then you should consider zoo() with the 
order.by argument, for example:

z <- zoo(rep(NA,390), order.by = start + 30 * 0:389)

If your data source actually provides the time stamps then this should 
be very easy.

Note that neither of these do consistency checking between the length of 
the series and the specified time frame, that is up to you to do. You 
might get warning messages later indicating that something is not right 
if you made a mistake. Your zooreg() above seems to just ignore the 
inconsistency whereas I think zoo() with order.by recycles the data.

Paul