title: Error: could not find function plot in R
body: <p>I was trying to estimate an ARIMA model by using my own function "foo". The error code could not find function plot in R came in nowhere. really bothers me. Any idea how that happened? I have tried the <code>stats:::plot</code> still doesn't work.  </p>
  
  <pre><code>```{r warning=FALSE, message=FALSE}
  require(forecast)
  foo &lt;- function(N, y1=1, p=0.8, q=1-p, seed=NULL, stepwise=TRUE, verbose=0) {
  if (!is.null(seed)) set.seed(seed)
  y &lt;- c(y1, rep(NA,N-1))
  for (i in 2:N) y[i] &lt;- p*y[i-1] + q*rnorm(1)
  if (verbose) plot(y, type='l', xlab='time')
  return (list(y=y, aa=auto.arima(y, stepwise=stepwise)))
  }
  v &lt;- foo(N=100, seed=10, verbose=1); v$aa$coef
  ```
  </code></pre>