[R] Turning a string into an expression

Stephen C. Upton upton at mitre.org
Mon Mar 3 14:51:44 CET 2003


Soren,

try
eval(parse(text=aaa))

HTH
steve

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
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list