[R] Turning a string into an expression

Uwe Ligges ligges at statistik.uni-dortmund.de
Mon Mar 3 14:47:03 CET 2003


Søren Højsgaard wrote:
> Dear all,
> I have e.g. 
> 	aaa <- "list(1,2,3,4)" 
> and would like to get a hold on the list 
> 	list(1,2,3,4)
> from aaa. Can anyone help with that?
> Best regards 
> Søren Højsgaard

Try
  parse(text=aaa)
for the expression and
  eval(parse(text=aaa))
to evaluate it.

Uwe Ligges




More information about the R-help mailing list