[Rd] pacf.mts

Paul Gilbert pgilbert at bank-banque-canada.ca
Thu Apr 10 17:46:21 MEST 2003


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 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
> 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 at biostat.ku.dk)             FAX: (+45) 35327907
> 
> ______________________________________________
> R-devel at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list