[R] Character2function

About this list Date view Thread view Subject view Author view

Alvaro Colina (acosa@ubu.es)
Tue, 30 Nov 1999 20:25:38 +0100



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@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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b3 on Tue 04 Jan 2000 - 13:34:02 EST