0
votes

I'm trying to get symbol data with quantmod using this code.

    getSymbols(c("^DJI"),src='yahoo',from='2014-11-24',to='2017-11-24')

And I get the error

    Error in 'colnames<-'('*tmp(', value = c("DJI.open", "DJI.High", "DJI.Low", :
    length of 'dimnames' [2] not equal to array extent

Thanks for any help.

Edit: I get the same error with normal tickers.

    getSymbols(c("DWDP","AAPL","MCD","MRK","IBM","MMM","KO","DIS","CSCO","PG","TRV","UTX","HD","PFE","MSFT","VZ","GS","WMT","GE","INTC","BA","JPM","AXP","XOM","NKE","CAT","CVX","JNJ","UNH","V"),src='yahoo',from='2014-11-24',to='2017-11-24')
1
I cannot reproduce this error with quantmod_0.4-11. Maybe look at conflicts(detail = TRUE) to see if you've accidentally clobbered some important function.MrFlick

1 Answers

0
votes

Without the c. Just do

getSymbols('^DJI', src = 'yahoo', from = '2014-11-24', to = '2017-11-24')

Reply to Edit:

Maybe your package and/or R is outdated. I ran your exact code

getSymbols(c("DWDP","AAPL","MCD","MRK","IBM","MMM","KO","DIS","CSCO","PG","TRV","UTX","HD","PFE","MSFT","VZ","GS","WMT","GE","INTC","BA","JPM","AXP","XOM","NKE","CAT","CVX","JNJ","UNH","V"),src='yahoo',from='2014-11-24',to='2017-11-24')

and was able to get all the prices.