[R-SIG-Finance] extract a particular hour of tick data from multiple days form xts object
Muhammad Abuizzah
izzah100 at yahoo.com
Thu Sep 29 01:36:06 CEST 2011
Hi,
I have an xts dataframe called a1. Its tick data for many months. The data is already in xts format so the first column is the index.
I reviewed the xts manual and on page 5 of the xts package manual it talks about extracting recurring times between 8:30 to 15:00 using the code .parseISO8601('T08:30/T15:00')
My objective is to assign names to certain recurring times such as to call the ticks prior to 9:30 "premarket" so obviously it's to work on a certain hour across all dates
It wasn't clear from the manual's example above how to construct the code so I tried the following and none worked:-
premkt <- a1 [.parseISO8601('T06:30/T9:30'),] ## used the example supplied by the manual to specify the rows I want from my dataframe
premkt <- .parseISO8601(a1,'T06:30/T9:30') ## again I wasn't sure how to use the example in the package so I tried to use the time bracket as an argument for a parseISO8601 function with my dataframe as the first argument
also tried premkt <- a1['T06:30/T9:30' ] ## I saw a question by someone in which such or similar code was used.
Thanks for the help in advance!!
.
More information about the R-SIG-Finance
mailing list