From ihaka at stat.auckland.ac.nz  Thu Jun 19 16:03:48 2003
From: ihaka at stat.auckland.ac.nz (Ross Ihaka)
Date: Thu Jun 19 05:04:14 2003
Subject: [Rd] acf   inherits problem
References: <029D5E4CC620344D9A54430DABC37F4307B6E3@BOC-EXMAIL1.bocad.bank-banque-canada.ca>
Message-ID: <3EF12814.90605@stat.auckland.ac.nz>

Paul Gilbert wrote:
> I think this is a bug, but perhap someone could confirm that it is not just me doing something stupid. (I vaguely recall something like this previously getting fixed in 1.7.0.)
> 
> R : Copyright 2003, The R Development Core Team
> Version 1.7.1  (2003-06-16)
> 
> 
>>z <-matrix(rnorm(100), 100,1)
>>acf(as.ts(z), type="partial")
> 
> Error in inherits(x, "ts") : evaluation is nested too deeply: infinite recursion?

I can can confirm that it's a bug the 1.8 development branch, but not in 
1.7.0. (I don't have a 1.7.1 on this machine at present.)  The problem 
seems to be in the acf.R in the ts library.

1.7.1, 1.8.0 etc. have

<     if(is.matrix(x))
<         return(pacf(as.ts(x), lag.max=lag.max, plot=plot,
<                     na.action=na.action, ...))

while 1.7.0 has.

 >     if(is.matrix(x)) {
 >         m <- match.call()
 >         m[[1]] <- as.name("pacf.mts")
 >         return(eval(m, parent.frame()))
 >     }

If I had to guess, I'd say that the call to the generic from a method is 
producing a loop.

-- 
Ross Ihaka                         Email:  ihaka@stat.auckland.ac.nz
Department of Statistics           Phone:  (64-9) 373-7599 x 85054
University of Auckland             Fax:    (64-9) 373-7018
Private Bag 92019, Auckland
New Zealand


[Rd] acf inherits problem
Ross Ihaka