Hi All,

I would like to work with symbols referenced by strings: I would like to manipulate data/symbols referencing to them by the string name of the symbol.

An example will be clearer. Let's I get a time series through quantmod

> getSymbols("GLD")

This will create a new symbol GLD with the relevant data. I have tried to rename the column names as follows:

> colnames(get("GLD")) <- c("open", "close", "low", "high", "volume", "adjusted")

will give the following error:

Error in colnames("GLD")<- c("open", "close", "low", "high", "volume",  :
  target of assignment expands to non-language object


I am confused as to how to do this.

(the intent of this is to maintain a list of tickers in string format and loop through them at ease to do whatever treatment)


Thanks for your help,

Emmanuel

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to