Skip to content

Problem with zoo and BootPR packages

5 messages · Gabor Grothendieck, Achim Zeileis, Ricardo Gonçalves

#
Contact the BootPR maintainer regarding a bug in this line of Plot.Fore:

   y1 <- zooreg(x, start, end, frequency)

where x is a ts object but that may not be used in that context.
as.zooreg is available for converting ts series (and certain other
objects) to zooreg objects.

2009/11/19 Ricardo Gon?alves Silva <ricardogs at terra.com.br>:
#
On Thu, 19 Nov 2009, Ricardo Gon?alves Silva wrote:

            
This is a bug in Plot.Fore() which does not use the zoo functions 
correctly. It should be reported to the package maintainer.

To avoid it, you can do
   Plot.Fore(as.vector(y1), ...)
instead of
   Plot.Fore(y1, ...)

Note to the maintainer (Jae Kim, Cc now): Plot.Fore() calls zooreg(x) 
where x is a "ts" object. This isn't the appropriate use of zooreg() which 
expects a numeric vector/matrix (or a factor). In the case above 
as.zoo(y1) would already be enough (and preserve all time information). Or 
you can manually call zooreg(coredata(y1), start = ..., end = ..., ....). 
See the zoo vignettes/examples for more details.

Best,
Z
#
Ok,

Thanks all.
Rick.

--------------------------------------------------
From: "Achim Zeileis" <Achim.Zeileis at wu-wien.ac.at>
Sent: Thursday, November 19, 2009 3:06 PM
To: "Ricardo Gon?alves Silva" <ricardogs at terra.com.br>
Cc: "R-Help" <r-help at r-project.org>; <J.Kim at latrobe.edu.au>
Subject: Re: [R] Problem with zoo and BootPR packages

            
#
Actually it may be that the documentation is at fault more than the
code.  The help page for Plot.Fore says that the first argument is a
time series data set and although that seems to suggest that it should
be a ts object the code seems to be written assuming a plain numeric
vector; therefore, you could do this:

library(zoo)
Plot.Fore(coredata(y1), forey1$forecast, start = 1966, end = 1984,
frequency = 1)

2009/11/19 Gabor Grothendieck <ggrothendieck at gmail.com>: