Execute {rGroovy}R Documentation

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.

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

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

 ## 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)


[Package rGroovy version 1.3 Index]