Hello,
I have a series of intraday (high-frequency) price data in the form of POSIX
timestamp followed by the value.
I sucesfuly loaded that into "its" package object. I would like to create
from it a regularly spaced time series of prices (for example 1min, 5min,
etc apart) so i could calcualte returns.
There is an interpolation function locf() that for timestamp with value NA
uses last known observation.
I guess the idea would be to start from the begining of my series and, for
example, if there is no timestamp for t+5min add that time with value NA.
Than I could use locf() function to fill those NAs. Finaly I should extract
from that series, series with 5min spaced timestamps with prices.
Appart from applying locf() function, I have no idea how to add NAs into
original series or extract the regular series after.
Can someone help me with this?
Thank you.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to