[R] a REALLY dumb question

Duncan Murdoch murdoch.duncan at gmail.com
Fri Oct 3 18:18:15 CEST 2014


On 03/10/2014 12:09 PM, Erin Hodgess wrote:
> So please be prepared...
>
> Ok.  I made a copy of the arima.r function called earima.r to put in some
> print statements.  Fair enough.
>
> Now when I run earima, the .Call statements call find the C subroutines.
>
> I know that this should be a really simple fix, but I don't know how.  I do
> know that the original arima function is in stats.
>
> Sorry for the trouble.
>
>
>
If you run

environment(arima) <- environment(stats::arima)

it should work (assuming your function is still called arima).  The 
problem is that statements like

  .Call(C_ARIMA_Like, y, mod, 0L, TRUE)

refer to variables like C_ARIMA_Like, which are local to the package 
environment of stats.  They aren't exported, so your function (which 
presumably has a different environment) can't see them.

Duncan Murdoch



More information about the R-help mailing list