I want to prompt a user for console input of a ticker symbol (e.g. GOOG) and then use the getSymbols function in the quantmod package of R to download the tick data for the given ticker symbol and create a plot using quantmod's barChart function.
I have
s1 <- readline("enter a symbol: ")
getSymbols(cat('"',s1,'"',sep=""),src="yahoo")
barChart(s1)
I get the following error message "Error in try.xts(x, error = "chartSeries requires an xtsible object") : chartSeries requires an xtsible object"
Using just the console (without prompting for input) I get the following to work:
> getSymbols("GOOG",src="yahoo")
[1] "GOOG"
> barChart(GOOG)
What am I missing?