Execute: Function executes the groovy script and returns the result....

Description Usage Arguments Examples

View source: R/rGroovy.R

Description

Function executes the groovy script and returns the result. Execute differs from Evaluate in that references to Groovy objects are not required. The call to Initialize is not required in order to call this function either however keep in mind that a new instance of groovy.lang.GroovyShell will be used every time this function is called.

Usage

1
Execute(groovyScript, variables = list())

Arguments

groovyScript

The groovy script being executed.

variables

The variables that will be passed to the binding that is used when the groovyScript is executed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 ## Not run: 
 variables <- list ()

 variables["name"] = "Tom"
 variables["day"]  = "Wednesday"

 groovyScript <- "return \"Hello ${name}, how are you doing? Today is ${day}.\""

 result <- Execute (groovyScript=groovyScript, variables=variables)
 result
 
## End(Not run)

rGroovy documentation built on April 1, 2018, 5:03 p.m.

Related to Execute in rGroovy...