[R] Plot two zoo object with different indexes

Manta mantino84 at libero.it
Tue Nov 23 18:53:36 CET 2010


Dear R community, I have the following two zoo objects:

MONTHLY CPI

> plot(z)
> par("usr")
[1] 1977.76333 2011.15333   70.39856  227.03744
> z=zooreg(cpius$Value,as.yearmon("1979-11"),frequency=12)
> str(z)
‘zooreg’ series from Nov 1979 to Oct 2010
  Data: num [1:372] 76.2 77 77.8 78.5 79.5 80.3 81.1 82 82 82.6 ...
  Index: Class 'yearmon'  num [1:372] 1980 1980 1980 1980 1980 ...
  Frequency: 12 

AND A DAILY SERIES IN THE SAME RANGE

> plot(y)
> par("usr")
[1]  3233.80000 15362.20000    70.42363   226.38559
> str(y)
‘zoo’ series from 1980-02-01 to 2010-10-31
  Data: num [1:11231] 76.2 76.2 76.3 76.3 76.3 ...
  Index: Class 'Date'  num [1:11231] 3683 3684 3685 3686 3687 ...

Now, due to a different index (and a different "usr" parameter for the
graphic) I am not able to plot the two series together. How shall I do?

Thanks
-- 
View this message in context: http://r.789695.n4.nabble.com/Plot-two-zoo-object-with-different-indexes-tp3055890p3055890.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list