Learn R Programming

rscala (version 3.2.25)

*.rscalaBridge: Evaluation Operator

Description

This operator compiles and executes a snippet of Scala code. All definitions are local to the supplied Scala snippet. Subsequent uses of the same code snippet skips the time-consuming compilation step. The return value is a vector or matrix of R's basic types (if possible) or an rscala reference (otherwise).

Usage

# S3 method for rscalaBridge
*(bridge, snippet)

Value

Returns a vector or matrix of R's basic types (if possible) or an rscala reference (otherwise).

Arguments

bridge

A Scala bridge.

snippet

String providing a Scala code snippet.

See Also

^.rscalaBridge, +.rscalaBridge, scala

Examples

Run this code
# \donttest{
s <- scala()
s * 'scala.util.Random.nextDouble() <= 0.75'
s(mean=10, sd=2.5) * 'mean + sd * scala.util.Random.nextGaussian()'
close(s)
# }

Run the code above in your browser using DataLab