From p.dalgaard at biostat.ku.dk  Thu Apr 10 23:03:00 2003
From: p.dalgaard at biostat.ku.dk (Peter Dalgaard BSA)
Date: Thu Apr 10 22:02:06 2003
Subject: [Rd] pacf.mts
In-Reply-To: <3E95C099.1C70E426@bank-banque-canada.ca>
References: <3E95C099.1C70E426@bank-banque-canada.ca>
Message-ID: <x2u1d6glxn.fsf@biostat.ku.dk>

Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:

> I think this is a bug. Sorry I'm still using a version from a couple of
> days ago.

It is, but maybe not the easiest one to fix, and we're already in code
freeze...

> >  library(ts)
> >  z <- matrix (rnorm(200), 100,2)
> > zz <- acf(z, plot=FALSE, type= "partial")$acf
> Error in eval(expr, envir, enclos) : couldn't find function "pacf.mts"

The issue is that certain programming techniques are not compatible
with namespaces. In this case we have in pacf.default:

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

but pacf.mts is not visible in the parent.frame(). Since the content
of the if() block is obviously nonfunctional, I suppose we could
accept a fix that is clearly local to the block. Does it work to set 

m[[1]] <- pacf.mts 

??

Then again, there's a fairly obvious workaround:

acf(as.ts(z), plot=FALSE, type= "partial")
    ********

(obviously, the same issues apply to pacf())


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907


[Rd] pacf.mts
Peter Dalgaard BSA