Data is downloaded as below:
prices <- getSymbols(symbols,
src = 'yahoo',
from = "2019-04-12",
auto.assign = TRUE,
warnings = FALSE) %>%
map(~Ad(get(.))) %>%
reduce(merge) %>%
colnames<-(symbols)
Then converted to differenced data:
p <- dailyReturn(prices$SPY, type = "log")
q <- dailyReturn(prices$IWM, type = "log")
then I am trying to do a simple auto.arima and autoplot forecast:
Error in if (object$spec$constant) { : argument is of length zero
I am unable to solve, there is no solutions on stack overflow, the problem is with the forecast command it presents inverse AR and MA charts which are completey useless.
Thank you, your code works perfectly. It enables me to finish my work now. I am so grateful. Thank you kindly.
The purr library was missing and there was general sloppy coding. It is not worth doing an autopsy on, just strive to do better.