[R] How to convert a string to the column it represents in a dataframe, with a reproducible example

David Winsemius dwinsemius at comcast.net
Thu Jan 17 23:06:46 CET 2013


On Jan 17, 2013, at 1:36 PM, mtb954 at gmail.com wrote:

> Hello R-helpers,
> 
> I have run the following lines of code:
> 
> x<-"cars$dist"
> y<-noquote(x)
> 
> 
> Now y is a string containing the characters "cars$dist"
> 
> My question....is there an R function (or combination of functions) that I
> can apply to y that will cause y to contain the numbers in cars$dist? Even
> better, can I do it without using noquote()?

What is the goal of this effort?

-- 

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list