[Rd] acf inherits problem
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Jun 19 08:45:41 MEST 2003
It's not the same problem as was fixed for 1.7.0, which was
namespace-related. It's clearer if you do
z <- as.ts(matrix(rnorm(100), , 1))
class(z)
pacf(z)
The problem is that you have an n x 1 matrix as a time series. That _is_
somewhat silly, and avoiding that avoids the problem (and it does not
occur in any of our test suites, unsurprisingly).
I think as.ts/ts ought to drop() such matrices.
The test
if (is.matrix(x))
has always been wrong in that case: it should be
if (is.matrix(x) && ncol(x) > 1)
The problem has long been there, just the wrong method was called and
coped in the past.
I've put a fix in R-patched.
On Wed, 18 Jun 2003, 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?
> > version
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-devel
mailing list