Error in `mutate()`: i In argument: `topdown = (function (object, ...) ...`. Caused by error in `switch()`: ! EXPR must be a length 1 vector

I am working on Hierarchical Time Series forecasts using fpp3 package. Everything was working good, unless I updated some of the packages and now when I am running the forecast(), its giving me an error:

Error in mutate():
i In argument: topdown = (function (object, ...) ....
Caused by error in switch():
! EXPR must be a length 1 vector

fit %>% select(topdown) %>% forecast(h = '21 days')

rlang::last_error()
<error/dplyr:::mutate_error>
Error in mutate():
i In argument: topdown = (function (object, ...) ....
Caused by error in switch():
! EXPR must be a length 1 vector


Backtrace:

  1. fit %>% select(topdown) %>% forecast(h = "21 days")
  2. fabletools:::forecast.lst_mdl(...)
  3. fabletools:::mapply_maybe_parallel(...)
  4. base::mapply(FUN = .f, ..., MoreArgs = MoreArgs, SIMPLIFY = SIMPLIFY)
  5. fabletools:::forecast.mdl_ts(...)
  6. fable:::forecast.ARIMA(...)
    Run rlang::last_trace() to see the full context.

I have also uploaded the last_trace() function for reference.

Need help urgently as I was very close to completing my project and this happened !!

Regards,
Sonaxy

Hi,

This issue is resolved now. I think some underlying packages were not installed properly. So, I just re-installed my R, and it is working now.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.