Re: [R] Plot two zoo object with different indexes

2010-11-23 Thread Gabor Grothendieck
On Tue, Nov 23, 2010 at 5:03 PM, Manta wrote: > > > Gabor Grothendieck wrote: >> >> How to convert a monthly series to a daily series has already been >> illustrated in multiple ways in this thread. >> > > Fair enough. However, my last question was different. I simply want to know > if there is a

Re: [R] Plot two zoo object with different indexes

2010-11-23 Thread Manta
Gabor Grothendieck wrote: > > How to convert a monthly series to a daily series has already been > illustrated in multiple ways in this thread. > Fair enough. However, my last question was different. I simply want to know if there is a simple neat way to import a monthly series as a zoo object

Re: [R] Plot two zoo object with different indexes

2010-11-23 Thread Gabor Grothendieck
On Tue, Nov 23, 2010 at 4:41 PM, Manta wrote: > > > Gabor Grothendieck wrote: >> >>> 2. How to import using as index 'Date' a monthly series (code below). The >>> series in the US CPI from November 1979 to October 2010. >>> >>> z <- zoo(cpius$Value, as.Date("1979-11-30")+0:372) >> >> Assuming the

Re: [R] Plot two zoo object with different indexes

2010-11-23 Thread Manta
Gabor Grothendieck wrote: > >> 2. How to import using as index 'Date' a monthly series (code below). The >> series in the US CPI from November 1979 to October 2010. >> >> z <- zoo(cpius$Value, as.Date("1979-11-30")+0:372) > > Assuming the question is how to turn this daily series into a monthly

Re: [R] Plot two zoo object with different indexes

2010-11-23 Thread Gabor Grothendieck
On Tue, Nov 23, 2010 at 3:58 PM, Manta wrote: > > Ok this helps definitely! But I still would like to know > > 1. How to change from one index to another within a 'zoo' object Using z <- zooreg(1:10, start = as.yearmon("2000-01"), freq = 12) Try aggregate(z, as.Date, identity) or ti

Re: [R] Plot two zoo object with different indexes

2010-11-23 Thread Manta
Ok this helps definitely! But I still would like to know 1. How to change from one index to another within a 'zoo' object 2. How to import using as index 'Date' a monthly series (code below). The series in the US CPI from November 1979 to October 2010. z <- zoo(cpius$Value, as.Date("1979-11-30")

Re: [R] Plot two zoo object with different indexes

2010-11-23 Thread Gabor Grothendieck
On Tue, Nov 23, 2010 at 1:11 PM, Manta wrote: > > Thanks as always Gabor. > > What I was looking for was to plot the daily series on the same graph of the > monthly using the command 'lines'. That is why I wanted to change the index > of one of the two, as it seems the reason why at the moment it

Re: [R] Plot two zoo object with different indexes

2010-11-23 Thread Manta
Thanks as always Gabor. What I was looking for was to plot the daily series on the same graph of the monthly using the command 'lines'. That is why I wanted to change the index of one of the two, as it seems the reason why at the moment it is not working! -- View this message in context: http:/

Re: [R] Plot two zoo object with different indexes

2010-11-23 Thread Gabor Grothendieck
On Tue, Nov 23, 2010 at 12:53 PM, Manta wrote: > > 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 1