[R] character string as object name

Patrick Burns pburns at pburns.seanet.com
Thu Mar 5 16:46:09 CET 2009


Does the first item on page 52 of 'The R Inferno'
explain it for you?  If not, can you give some
hints about how to improve the explanation?


Patrick Burns
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of "The R Inferno" and "A Guide for the Unwilling S User")

Fuchs Ira wrote:
> Can someone please tell me why the following (last line) doesn't work 
> (as I expect it to :-)
>
> library(quantmod)
> a = getSymbols("MSFT",from="2009-3-01")
> a
> MSFT
> eval(as.name(a))
> MSFT$MSFT.Adjusted
> b=paste(a,'$MSFT.Adjusted',sep='')
> b
> eval(as.name(b))
>
> Why does this last line not work the way the earlier eval does?
>
> Thanks.
>
> ______________________________________________
> R-help at 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.
>
>




More information about the R-help mailing list