Skip to content
Prev 319331 / 398506 Next

Zoo Data

It's much easier to use xts' time-of-day subsetting:

library(xts)
dat1 <- as.xts(read.zoo(text="TIME, Value1, Value2
01.08.2011 02:30:00, 4.4, 4.7
01.09.2011 03:00:00, 4.2, 4.3
01.11.2011 01:00:00, 3.5, 4.3
01.12.2011 01:40:00, 3.4, 4.5
01.01.2012 02:00:00, 4.8, 5.3
01.02.2012 02:30:00, 4.9, 5.2
01.08.2012 02:30:00, 4.1, 4.7
01.12.2012 03:00:00, 4.7, 4.3
01.01.2013 01:00:00, 3, 4.3
01.01.2013 01:30:00, 3.8, 4.1
01.01.2013 02:00:00, 3.8, 4.3
01.01.2013 02:30:00, 3.9, 4.2
01.01.2013 03:00:00, 3.7, 4.5
01.01.2013 03:30:00, 3.5, 4.1
01.02.2013 02:00:00, 3.8, 4.3
02.02.2013 04:30:00, 3.9, 4.2",
sep=",", header=TRUE, FUN=as.POSIXct, format="%d.%m.%Y %H:%M:%S"))

dat1["T02:30/T03:00"]

Best,
--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com

R/Finance 2013: Applied Finance with R  | www.RinFinance.com
On Sat, Mar 9, 2013 at 11:59 AM, arun <smartpink111 at yahoo.com> wrote: