Why does knitr show a warning using auto.arima?

It seems that running auto.arima from the forecast package in a knitr script always generates a warning - and I don't get this warning when I run it in normal R.

knitr Markdown Sample code:

 ```{r} library(forecast) ``` Spurious warning from forecast and knitr ======================================== The following generates a warning that I don't think is valid ```{r} summary(auto.arima(WWWusage)) ``` 

Produces the following:

knitroutput

While doing the following in R usually does not raise such a warning:

 > library(forecast) This is forecast 4.02 > summary(auto.arima(WWWusage)) Series: WWWusage ARIMA(1,1,1) Coefficients: ar1 ma1 0.6504 0.5256 se 0.0842 0.0896 sigma^2 estimated as 9.793: log likelihood=-254.15 AIC=514.3 AICc=514.55 BIC=522.08 Training set error measures: ME RMSE MAE MPE MAPE MASE 0.3035616 3.1137542 2.4052748 0.2805566 1.9174634 0.5315228 

Also, since this dataset is an example of a dataset for auto.arima , I tend to believe the warning is incorrect (since I suspect a “good” example will be shown).

Any idea what is going on?

+7
source share
1 answer

This warning existed, but it was suppressed internally by forecast ; see options(warn = -1) in forecast:::search.arima .

knitr (actually the evaluate package) captures warnings regardless of the value of getOption('warn') . In this case, you should use the warning=FALSE option, as suggested by Jilber.

+8
source

All Articles