From pgilbert at bank-banque-canada.ca  Thu Apr 10 17:46:21 2003
From: pgilbert at bank-banque-canada.ca (Paul Gilbert)
Date: Thu Apr 10 22:47:33 2003
Subject: [Rd] pacf.mts
References: <3E95C099.1C70E426@bank-banque-canada.ca>
	<x2u1d6glxn.fsf@biostat.ku.dk>
Message-ID: <3E95D81D.8C5D4364@bank-banque-canada.ca>

Ok, I can use

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

whether we call it a work around or the proper usage. (My way has worked
for a long time in both R and Splus, but I'm prepared to modernize.)

But shouldn't the error message say something about not finding a
default method?

Paul

Peter Dalgaard BSA wrote:
> 
> 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
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel


[Rd] pacf.mts
Paul Gilbert