[R-SIG-Finance] write.xts() and read.xts()

Brian G. Peterson brian at braverock.com
Fri Sep 25 16:58:09 CEST 2009


Wind wrote:
> There are write.zoo() and read.zoo() in the zoo package.   But there are no
> write.xts() or read.xts() in the xts package.Since xts is so powerful
> manipulating historic prices, I wonder how do you save those xts.   Write
> your own function like write.zoo for xts?   Or just use write.zoo and
> read.zoo and convert to xts again?  It seems that the attributes of xts
>  could not be maintained in the zoo-like way
I typically use read.zoo to read CSV or similar data into R.  This is 
then trivially converted to xts.

Once in R, I typically save my data of all types as binary .Rdata files 
using "save".  I only write data to CSV files using write.csv, 
write.table, or write.zoo when I need to export it for use by others.  
The binary formats are much faster to load and use than constantly 
converting back and forth from text.

Regards,

  - Brian

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list