string - Treat a Character as a variable -


suppose have following code

a<-c(1,2,3) b<-'a' 

now treat string in 'b' variable 'a' when input function or operation. imagine "treat.as.variable()" real function this:

treat.as.variable(b)+c(1,2,4) [1] 2 4 7 

is there function this, predefined? or way in general?

use get function

> get(b) + c(1,2,4) [1] 2 4 7 

Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

how to receive file in java(servlet/jsp) -