[R-SIG-Finance] getSymbols is zoo or xts?

Guillaume Yziquel guillaume.yziquel at citycable.ch
Sat Dec 5 02:42:59 CET 2009


Jeff Ryan a écrit :
> I don't know if guaranteed is correct.  I'd say it is xts more often
> than not, but when 'not' it is zoo.
> 
> I think I would say xts to be conservative, but I certainly don't
> understand your problem completely, so I am afraid I cannot be of more
> help.

My problem is very simple: I have to give a type to the timeseries 
object I receive. No type checking will be done at runtime (like Python, 
R). Only type checking at compile time (like C, C++, Java).

So I have to know what the type of the timeseries will be. zoo or xts?

As I understand it, xts is built over zoo. If that means that all zoo 
attributes and methods have the same semantics in xts, then I'd rather 
go for zoo. To be conservative.

Because if I type getSymbol's "output" as an xts timeseries, I will have to:

-1- make a type check at runtime, which isn't really sexy,

-2- if I get a zoo timeseries instead of an xts one, I'll have to throw 
and catch an exception at runtime, which would be cumbersome.

That's my issue: Type safety in OCaml.

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/



More information about the R-SIG-Finance mailing list