0
votes

I'm getting a really funny error with R (quantmod), what im trying to achieve is find multiple symbols from yahoo and store them in an array. I'm getting the symbols from a CSV file and the error im getting is the following:

Error in getSymbols.173(Symbols = NULL, env = , verbose = FALSE, : could not find function "getSymbols.173"

here is my code:

stockNamesBMV<-read.csv("AccionesBMV.csv",header=TRUE)

stocks<-stockNamesBMV[2]

print(stocks[3,1])
for(i in 1:nrow(stocks))
{
  AllSymbols[i]<-getSymbols(stocks[i,1],src="yahoo",from=date,to=Sys.Date(),auto.assign = TRUE)
}

what im getting from the print is the following:

[1] AEROMEX.MX

173 Levels: AC.MX ACTINVRB.MX AEROMEX.MX AG.MX AGUA.MX ALFAA.MX ALPEKA.MX ALSEA.MX AMXA.MX AMXL.MX ... WALMEX.MX

im not sure if the error comes from how im reading the array but i find pretty weird that print is showing me 173 levels thing not sure if that 173 is the one affecting me.

edit: Found out what was wrong. The problem is the 1st parameter has to be a string and i was sending an object, so doing this works:

AllSymbols[i]<-getSymbols(toString(stocks[i,1]),src="yahoo",from=date,to=Sys.Date(),auto.assign = FALSE)
1
Found out what was wrong. The problem is the 1st parameter has to be a string and i was sending an object, so doing this: AllSymbols[i]<-getSymbols(toString(stocks[i,1]),src="yahoo",from=date,to=Sys.Date(),auto.assign = FALSE)Makenshi

1 Answers

0
votes

Found out what was wrong. The problem is the 1st parameter has to be a string and i was sending an object, so doing this works:

AllSymbols[i]<-getSymbols(toString(stocks[i,1]),src="yahoo",from=date,to=Sys.Date(),auto.assign = FALSE)