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

Jeff Ryan jeff.a.ryan at gmail.com
Fri Sep 25 16:59:55 CEST 2009


The one issue with text based storage is that attributes are difficult
to handle.  As attributes on xts objects (any objects) can be any
legal R object, it requires some form of serialization to record as
text.

This is doable with dput.  Aside from Gabor's suggestion, the only way
to save everything in an xts object is to save it in binary form via
save/.saveRDS.  This should be portable and fast, though not obviously
in text/human-readable form.

That said, I'll add write.xts and read.xts at some point in the near future.

Thanks,
Jeff

On Fri, Sep 25, 2009 at 9:54 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> Try:
>
> x <- as.xts(read.zoo(...))
> write.zoo(as.zoo(x), ...)
>
> On Fri, Sep 25, 2009 at 10:49 AM, Wind <windspeedo99 at gmail.com> 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.
>> Thanks.
>>
>> Wind
>>
>>        [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-SIG-Finance at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
>>
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list