robjhyndman / forecast

Forecasting Functions for Time Series and Linear Models
http://pkg.robjhyndman.com/forecast
1.12k stars 342 forks source link

auto.arima prints newline when "No suitable ARIMA model found" #489

Closed basjacobs93 closed 7 years ago

basjacobs93 commented 7 years ago

In the following snippet, an unwanted newline is printed by auto.arima

library(forecast)
train <- ts(1:120, frequency = 52)
train_ext <- ts(rep(0, 120), frequency = 52)
try(stlm(train, lambda=0, method="arima", xreg = train_ext), silent = TRUE)

It is caused by cat("\n") in line 463 newarima2.R, right before stop("No suitable ARIMA model found"). Removing that line fixes the issue, but I am not sure if it is needed for anything else.

robjhyndman commented 7 years ago

Thanks. Fixed in https://github.com/robjhyndman/forecast/commit/29db025df47f6b2866343bcfe52fdcd082408c54