Closed technocrat closed 2 years ago
Thanks for the report. Can you please try installing smooth v3.1.2 from github via remotes::install_github("config-i1/smooth")
to see if the issues persists?
This works properly under v3.1.2. Thanks for the fix. And confirming my sanity.
@config-i1 We upgraded "smooth" package in our organization servers and now I am facing this exact issue which was reported here. We are using
Rversion -4.1.0 Most of our forecasting scripts are failing which are using sma() function with smooth_3.1.2. Whereas when we downgrade the smooth_3.0.1 it works fine with forecast() function. Need your immediate help on this.
Hi @hjoshi92,
That's weird. Sorry to hear that. Do you get exactly the same error? If yes, then this means that there is a conflict in forecast methods. Use greybox::forecast(model) and see if it works. But this should not appear in the first place, so that's not normal.
Also, can you provide a reproducible code? Including the sequence of loaded packages...
Hello @config-i1,
Yes I get the exact same error. I also observed that there are 3 packages (i.e forecast, smooth and greybox) having a same function called forecast().
When I tried using
forecast::forecast(ourModel) Error in is.constant(y) : 'list' object cannot be coerced to type 'double'
smooth::forecast(ourModel) Error: 'forecast' is not an exported object from 'namespace:smooth'
greybox::forecast(ourModel) No Error it gives correct output
Also, I observed few points in here, but I am unaware of the reason:
So as per your suggestion my issue got resolved after using greybox::forecast(). Thanks for your help.
I'm glad that it worked out. But in the ideal world, you wouldn't need to do greybox::forecast()
, it should work with just forecast()
. So, just to check, what is the order of packages loaded in that case? Also, if you change the order, does it work?
For example:
library(forecast)
library(greybox)
library(smooth)
forecast(ourModel)
vs
library(greybox)
library(smooth)
library(forecast)
forecast(ourModel)
@config-i1,
We are loading smooth first and then forecast. We have many models been built from forecast package and in middle of the complete model building function we have sma() from smooth package. So for our case its recommended to use greybox::
Thanks for the info.
I'm not sure why, but I cannot reproduce this on my PC. It works in that order (and in the other one as well). Do you also have fabletools installed? Is it loaded?
Hi @hjoshi92,
If possible, can you please check the most recent versions of greybox
and smooth
by installing them from github using:
remotes::install_github("config-i1/greybox")
remotes::install_github("config-i1/smooth")
Then let me know if the basic commands work (i.e. forecast(ourModel)
instead of greybox::forecast(ourModel)
).
This should be fixed now.
Under R 4.0.4, Ubuntu 20.10
I came to the example with the same error on my own argument, but found the same problem. I resolved mine by giving an express
order
argument. Does the example need one?Complete code