[R] Character2function

Alvaro Colina acosa at ubu.es
Tue Nov 30 20:25:38 CET 1999


If I have several character vectors, for example:

a_c('data.')
b_c('_myfunction(')
c_c('vect.')
d_c(')')

and, j_1

I can build a vector using paste:
x_paste(a,j,b,c,j,d,sep="") 

x="data.1_myfunction(vect.1)"

I have n numeric vectors (vect.1...vect.n)
Then, if I could evaluate the string x, I would calculate the
result of my function in n-vectors using a loop 
for (j in 1:n){
x_paste(a,j,b,c,j,d,sep="")
function.to.evaluate.string(x)
}
As a result, I would have n data.j objects

I've been looking for a function in R to evaluate a string
and I haven't found anyone.

Is there any function to do that?

Thank you very much
-- 
==============================================================
Alvaro Colina    		|-|o||o||o||o||o||o||o||o||o|- 
Area de Quimica Analitica	| Pza. Misael Banuelos s/n
Facultad de Ciencias		| 09001. Burgos. Spain
Universidad de Burgos		| Phone: 34-947-258817
e-mail: acosa at ubu.es	  	| FAX: 	 34-947-258831
==============================================================
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list