R – write.csv missing data

http://stackoverflow.com/questions/15796499/date-information-disappears-when-save-to-csv

 

as SPY is a xts/zoo object this will do the trick:

replace:

write.csv(SPY, "C:/SPY.csv")

with

write.zoo(SPY,"C:/SPY.csv",index.name="Date",sep=",")

歷史上得今天..

Leave a Reply

Your email address will not be published. Required fields are marked *