How do I rename an R object?

Posted by Milktrader on Stack Overflow See other posts from Stack Overflow or by Milktrader
Published on 2010-04-26T23:46:11Z Indexed on 2010/04/27 0:13 UTC
Read the original article Hit count: 519

Filed under:
|

I'm using the quantmod package to import financial series data from Yahoo.

library(quantmod)
getSymbols("^GSPC")
[1] "GSPC"

I'd like to change the name of object "GSPC" to "SPX". I've tried the rename function in the reshape package, but it only changes the variable names. The "GSPC" object has vectors GSPC.Open, GSPC.High, etc. I'd like my renaming of "GSPC" to "SPX" to also change GSPC.Open to SPX.Open and so on.

© Stack Overflow or respective owner

Related posts about r

    Related posts about rename