Skip to content

Importing intra day data

3 messages · ehxpieterse, Jeff Ryan, Brian G. Peterson

#
Hi,

I am reading intra day data into R using:

EWW <- read.table("EWW.txt", sep=",", header =TRUE)

EWW text file:

"Date","Time","Open","High","Low","Close","Volume"
07/01/1998,10:07:00,12.63,12.63,12.63,12.63,500
07/01/1998,10:27:00,12.75,12.75,12.75,12.75,100
07/01/1998,10:29:00,12.75,12.75,12.75,12.75,100
07/01/1998,11:07:00,12.75,12.75,12.75,12.75,100
07/01/1998,13:49:00,12.75,12.75,12.75,12.75,1000
07/01/1998,14:15:00,12.94,12.94,12.94,12.94,600

I think I am having trouble converting the data to xts type, due to the date
and time fields being contained in seperate variables.
Error in as.POSIXlt.character(x, tz, ...) : 
  character string is not in a standard unambiguous format

Has anyone come across a similar problem before?

Thanks,
Eduard
#
The answer lies in the error:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
07/01/1998 is ambiguous, and not ISO 8601.
http://en.wikipedia.org/wiki/ISO_8601

CCYY-MM-DD would be correct, and CCYY-MM-DD HH:MM:SS is preferred.

try something like:
Open  High   Low Close Volume
1998-07-01 10:07:00 12.63 12.63 12.63 12.63    500
1998-07-01 10:27:00 12.75 12.75 12.75 12.75    100
1998-07-01 10:29:00 12.75 12.75 12.75 12.75    100
1998-07-01 11:07:00 12.75 12.75 12.75 12.75    100
1998-07-01 13:49:00 12.75 12.75 12.75 12.75   1000
1998-07-01 14:15:00 12.94 12.94 12.94 12.94    600

HTH
Jeff

  
    
#
ehxpieterse wrote:
This question has been asked and answered multiple times on this list.

Please *search the archives* before posting.

See: http://catb.org/esr/faqs/smart-questions.html

Regards,

    - Brian