[Rd] pacf.mts

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Apr 10 23:03:00 MEST 2003

Paul Gilbert <pgilbert at 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

> >  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 at biostat.ku.dk)             FAX: (+45) 35327907

More information about the R-devel mailing list