Hello Everyone,

I am trying to convert the txt file into RData format by using convert
function in RTAQ package.The txt file looks like:

2010-07-01 08:04:28 SBUX Q 24.9500 100 T 0 0
2010-07-01 08:04:28 SBUX Q 24.9500 100 T 0 0
2010-07-01 08:04:28 SBUX Q 24.9600 300 T 0 0

The code I am using is:

> convert(from="2010-07-01",to="2010-07
-01",datasource="C:\\workdirectory\\TAQdata",datadestination="C:\\workdirectory\\datadestination",trades=T,quotes=F,ticker="SBUX",dir=F,format="%Y-%m-%d
%H:%M:%S",)
Warning message:
In read.table(file = file, header = header, sep = sep, quote = quote,  :
  incomplete final line found by readTableHeader on
'C:\workdirectory\TAQdata/2010-07-01/SBUX_trades.txt'
> sbux.t <-
TAQLoad(tickers="SBUX",from="2010-07-01",to="2010-07-01",trades=T,quotes=F,datasource="C:\\workdirectory\\datadestination")
> head(sbux.t,3)

I am getting the following output:

     SYMBOL       EX     PRICE     SIZE  COND CORR G127
<NA> "2010-07-01" "SBUX" "24.9500" "100" "1"  "0"  "0"
<NA> "2010-07-01" "SBUX" "24.9500" "100" "1"  "0"  "0"
<NA> "2010-07-01" "SBUX" "24.9600" "300" "1"  "0"  "0"
Warning message:
timezone of object (GMT) is different than current timezone ().

But my desired output is:

                               SYMBOL EX PRICE SIZE COND CORR G127
2010-07-01 08:04:28 "SBUX" "Q" "24.9500" " 100" "T" "0" "0"
2010-07-01 08:04:28 "SBUX" "Q" "24.9500" " 100" "T" "0" "0"
2010-07-01 08:04:28 "SBUX" "Q" "24.9600" " 300" "T" "0" "0"

Can someone please help?

Thanks

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to