[R-sig-Finance] zoo object -> ts object

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Thu May 18 18:38:27 CEST 2006


On Thu, 18 May 2006 10:31:44 +0100 nop27392 at mail.telepac.pt wrote:

> Dear all,
> 
> I obtained data from the net using
> 
> get.hist.quote(instrument = "^DJI", start = "1995-01-01", end =
> "2004-12-31", quote = "Close")
> 
> as suggested n this discussion. The result is a zoo object. How to
> transform it in time series object in order to perform log-return etc?

If z is your "zoo" object:
z <- get.hist.quote(instrument = "^DJI", start = "1995-01-01",
  end = "2004-12-31 ", quote = "Close")
then you can do
  plot(diff(log(z)))

So why convert to another class?
See vignette("zoo") for more information on "zoo" and its relations to
other time series classes.

hth,
Z


> Thanks in advance
> Vitor Teixeira
> 
> _______________________________________________
> R-sig-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>



More information about the R-SIG-Finance mailing list