[R] evaluate a string

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Jun 26 11:19:01 CEST 2002

Joerg Maeder wrote:
> Hello together
> i want to execute different commands that are saved in strings (eg: "d
> <- 4+7" and some more complicated things). How can i execute/evaluate
> them. I know i could save them to a temp-file a read this with source.
> But is there a way without a file in the middle?
> I know also the 'assign' command but I think it would only the simply
> cases.

 eval(parse(text = "d <- 4 + 7"))

Uwe Ligges
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