Possible Duplicate:
R: getting a function name as a string
1) I have a variable that stores data in the first column of a text file (stock ticker symbols)
tickers <- read.csv("stocks.txt", header=FALSE, sep=",")
tickers <- tickers[1]
2) For each ticker I run: getSymbols(tickers, from=startdate, to=enddate)
getSymbols is from the quantmod package
The result of calling 'getSymbols' is a series of xts objects that have the same name as the names in the tickers variable.
Now what I want to do is determine the date of the first element in each of the xts objects. Since each object has the same name as the ticker symbol associated with it in tickers variable I thought I could just do the following in a for loop where i is the index iteration:
min(index(tickers[i]))
However this does not work because tickers[1] returns a character name and not an object which index() is expecting. The problem is the character returned by tickers[1] is the name of the xts object created by getSymbols.
I appreciate the help. Thank you