Learn R Programming

DescTools (version 0.99.19)

Exec: Execute a Command Given As String

Description

Execute a piece of code.

Usage

Exec(x)

Arguments

x
the code to be executed

Details

This is just a wrapper to eval and parse, but easier to remember...

See Also

eval, parse

Examples

Run this code
A <- "This"
B <- "is"
C <- "a text"
for(s in LETTERS[1:3])
  Exec(gettextf("print(%s)", s))

Run the code above in your browser using DataLab