[R-SIG-Finance] intradaily data from bloomberg EXCEL file (ITS)

Gabor Grothendieck ggrothendieck at gmail.com
Tue Aug 19 17:53:27 CEST 2008


One correction.  See below.

On Tue, Aug 19, 2008 at 11:39 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> This works for me:
>
> Lines <- "1/2/2008 18:21,90.75
> 1/2/2008 18:22,89.29
> 1/2/2008 18:24,89.3
> 1/2/2008 18:27,89.33
> 1/2/2008 19:22,88.6
> 1/2/2008 19:52,88.26
> 1/2/2008 20:03,88.12
> 1/2/2008 21:28,88.45
> 1/2/2008 21:43,88.37
> 2/2/2008 0:14,88.37
> 4/2/2008 16:35,88.37
> 4/2/2008 17:09,88.33
> 4/2/2008 17:23,89.05
> 4/2/2008 17:52,88.91
> 4/2/2008 18:30,89.13
> 4/2/2008 18:49,89
> 4/2/2008 18:54,88.95
> 4/2/2008 21:27,89.3"
>
> library(its)
> x <- readcsvIts(textConnection(Lines), header = FALSE, informat
> ="%d/%m/%Y %H:%M")
> y <- its(x)
>
> # as does this
>
> library(z)
> z <- read.zoo(textConnection(Lines), header = FALSE,
>        tz = "", format = "%d/%m/%Y %H:%M")

Last statement should be:

z <- read.zoo(textConnection(Lines), header = FALSE,
        tz = "", format = "%d/%m/%Y %H:%M", sep = ",")

> y2 <- as.its(z)
>
>
> On Tue, Aug 19, 2008 at 10:58 AM, Vorlow Constantinos
> <CVorlow at eurobank.gr> wrote:
>> Hi,
>>
>> I have a .CSV file that goes like this:
>>
>> 1/2/2008 18:21,90.75
>> 1/2/2008 18:22,89.29
>> 1/2/2008 18:24,89.3
>> 1/2/2008 18:27,89.33
>> 1/2/2008 19:22,88.6
>> 1/2/2008 19:52,88.26
>> 1/2/2008 20:03,88.12
>> 1/2/2008 21:28,88.45
>> 1/2/2008 21:43,88.37
>> 2/2/2008 0:14,88.37
>> 4/2/2008 16:35,88.37
>> 4/2/2008 17:09,88.33
>> 4/2/2008 17:23,89.05
>> 4/2/2008 17:52,88.91
>> 4/2/2008 18:30,89.13
>> 4/2/2008 18:49,89
>> 4/2/2008 18:54,88.95
>> 4/2/2008 21:27,89.3
>>
>> of high freq. intradaily data (prices by the minute of an asset
>> downloaded from Bloomberg LP) and I am trying to use th following lines
>> to read them into R:
>>
>>
>>>    its.format("%d/%m/%Y %H:%M")
>>
>>
>> It seems that R reads them ok (readcsvIts(filename="a.csv")) as it
>> recognizes times and dates and aligns them to the corresponding prices :
>>
>> 19/08/2008 12:18 112.03
>> 19/08/2008 12:19 112.05
>> 19/08/2008 12:20 112.14
>> 19/08/2008 12:21 112.23
>> 19/08/2008 12:22 112.16
>> 19/08/2008 12:23 112.15
>> 19/08/2008 12:24 112.18
>> 19/08/2008 12:25 112.18
>> 19/08/2008 12:27 112.14
>> 19/08/2008 12:28 112.09
>> 19/08/2008 12:31 111.94
>> 19/08/2008 12:32 111.95
>> 19/08/2008 12:33 111.95
>>
>>
>> However, when I try to pass them to a variable I get:
>>
>>
>>> CL1<-its(readcsvIts(filename="a.csv"))
>> Error in validObject(.Object) :
>>  invalid class "its" object: Missing values in dates
>>>
>>
>>
>> I checked the data file and everything is fine. I think I have a problem
>> with the format (date/time)...
>>
>> Can anybody help?
>>
>> Also:
>>
>> Can I read them into a ZOO object instad of an ITS???
>>
>> Many TKS in advance,
>>
>> Costas
>>
>>
>>
>>
>> P Think before you print.
>>
>> Disclaimer:
>> This e-mail is confidential. If you are not the intended recipient, you should not copy it, re-transmit it, use it or disclose its contents, but should return it to the sender immediately and delete the copy from your system.
>> EFG Eurobank Ergasias S.A. is not responsible for, nor endorses, any opinion, recommendation, conclusion, solicitation, offer or agreement or any information contained in this communication.
>> EFG Eurobank Ergasias S.A. cannot accept any responsibility for the accuracy or completeness of this message as it has been transmitted over a public network. If you suspect that the message may have been intercepted or amended, please call the sender.
>>
>>
>>        [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-SIG-Finance at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
>>
>



More information about the R-SIG-Finance mailing list