[R] RTAQ - convert function: warning causes incorrect loading of data

caprarn9 caprarn9 at cs.man.ac.uk
Fri Oct 12 20:01:13 CEST 2012


Hello,

I am closely following the RTAQ documentation in order to load my dataset
into R, however I get this warning when running the convert function in the
following way:

convert(from="2010-11-01", to="2010-11-01",datasource=datasource,
datadestination=datadestination,trades=T,quotes=T,ticker="BAC",dir=T,
extention="csv", header=T, tradecolnames=c("SYMBOL", "DATE", "TIME",
"PRICE", "SIZE", "G127", "CORR", "COND", "EX"), quotecolnames=c("SYMBOL",
"DATE", "TIME", "BID", "OFR", "BIDSIZ", "OFRSIZ", "MODE", "EX"))

The only warning returned is:
In `[<-.factor`(`*tmp*`, is.na(tdata$G127), value = c(1L, 1L, 1L,  :
  invalid factor level, NAs generated

As it is a warning, the .RData files still get created and I can use TAQLoad
to load them:

x <-
TAQLoad("BAC",from="2010-11-01",to="2010-11-01",datasource=datadestination,
trades=T,quotes=T)

The PROBLEM:
head(x)
     SYMBOL EX  PRICE     SIZE    COND CORR G127
<NA> "BAC"  "B" "11.4900" "  500" "@"  "0"  "0" 
...

This is the same for the quotes objects, but different headers obviously. I
get a <NA> instead of the expected YYY-MM-DD HH:MM:SS format for each
observation. 

I've spent a fair number of hours on trying to get this right, no success. 
Can you please provide me with some guidance?

Thank you.

A sample from the CSV files I use:

SYMBOL,DATE,TIME,BID,OFR,BIDSIZ,OFRSIZ,MODE,EX
BAC,20101101,9:30:00,11.5,11.51,5,116,12,P
...

SYMBOL,DATE,TIME,PRICE,SIZE,G127,CORR,COND,EX
BAC,20101101,10:30:00,11.49,500,0,0,@,B
...




--
View this message in context: http://r.789695.n4.nabble.com/RTAQ-convert-function-warning-causes-incorrect-loading-of-data-tp4646025.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list