Retrieving stored ARIMA model using REACTIVE function -- Error in as.vector: cannot coerce type 'closure' to vector of type 'character

Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

Error in as.vector: cannot coerce type 'closure' to vector of type 'character

I feel the error message is pretty clear, somewhere a function (closure) is being applied where a vector of type character is expected. I'm pretty sure the lines where you define m_arima_model and m_valid_data are just setting them us as functions, so when you apply them to forecast you get this error.

Note

library(shiny)
m_arima_model <- reactive({
  readRDS()
})
typeof(m_arima_model)
#> [1] "closure"

Created on 2018-08-01 by the reprex package (v0.2.0.9000).


1 Like