Skip to content
Prev 369755 / 398503 Next

How Can I Execute a String Expression?

eval(parse(text = yourstring))  # your string must be  quoted, because
that's what a string is.

But .... don't do this! (usually)

install.packages("fortunes") ## if not already downloaded and installed
library("fortunes")
fortune(106)

See ?substitute and ?bquote for perhaps better ways to proceed.

Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Jun 12, 2017 at 6:55 PM, Donald Macnaughton <donmac at matstat.com> wrote: