com.apama.r
Event RConnection


Utilities for interacting with R and Rserve.
Since:
10.1

Action summary
 voidclose()

Close the R connection.
 anyevaluate(string value)

Evaluate a string as some R script returning an any type. The return type is generic, the client must process the return type. The type would depend on what R returned (i.e. could be multi-dimensional matrix).
 booleanevaluateAsBoolean(string value)

Evaluate a string as some R script returning a boolean. The return type is boolean if the object returned by R is of boolean type, otherwise it will throw CastException.
 floatevaluateAsFloat(string value)

Evaluate a string as some R script returning a float. The return type is float if the object returned by R is of float type, otherwise it will throw CastException.
 sequence<float>evaluateAsFloatSequence(string value)

Evaluate a string as some R script returning a sequence of floats. The return type is sequence of floats if the object returned by R is of float array type, otherwise it will throw CastException.
 integerevaluateAsInteger(string value)

Evaluate a string as some R script returning an integer. The return type is integer if the object returned by R is of integer type, otherwise it will throw CastException.
 sequence<integer>evaluateAsIntegerSequence(string value)

Evaluate a string as some R script returning a sequence of integers. The return type is sequence of integers if the object returned by R is of integer array type, otherwise it will throw CastException.
 stringevaluateAsString(string value)

Evaluate a string as some R script returning a string. The return type is string if the object returned by R is of string type, otherwise it will throw CastException.
 voidevaluateVoid(string value)

Evaluate a string as some R script.
 voidset(string name, any value)

Set an R value.
 
Action detail

close

void close()
Close the R connection.

evaluate

any evaluate(string value)
Evaluate a string as some R script returning an any type. The return type is generic, the client must process the return type. The type would depend on what R returned (i.e. could be multi-dimensional matrix).
Parameters:
value - The string value to be evaluated.
Returns:
Returns any object which end user has to handle

evaluateAsBoolean

boolean evaluateAsBoolean(string value)
Evaluate a string as some R script returning a boolean. The return type is boolean if the object returned by R is of boolean type, otherwise it will throw CastException.
Parameters:
value - The string value to be evaluated.
Returns:
Result of evaluation as a boolean.

evaluateAsFloat

float evaluateAsFloat(string value)
Evaluate a string as some R script returning a float. The return type is float if the object returned by R is of float type, otherwise it will throw CastException.
Parameters:
value - The string value to be evaluated.
Returns:
Result of evaluation as a float.

evaluateAsFloatSequence

sequence<floatevaluateAsFloatSequence(string value)
Evaluate a string as some R script returning a sequence of floats. The return type is sequence of floats if the object returned by R is of float array type, otherwise it will throw CastException.
Parameters:
value - The string value to be evaluated.
Returns:
Result of evaluation as a sequence of floats.

evaluateAsInteger

integer evaluateAsInteger(string value)
Evaluate a string as some R script returning an integer. The return type is integer if the object returned by R is of integer type, otherwise it will throw CastException.
Parameters:
value - The string value to be evaluated.
Returns:
Result of evaluation as a integer.

evaluateAsIntegerSequence

sequence<integerevaluateAsIntegerSequence(string value)
Evaluate a string as some R script returning a sequence of integers. The return type is sequence of integers if the object returned by R is of integer array type, otherwise it will throw CastException.
Parameters:
value - The string value to be evaluated.
Returns:
Result of evaluation as a sequence of integers.

evaluateAsString

string evaluateAsString(string value)
Evaluate a string as some R script returning a string. The return type is string if the object returned by R is of string type, otherwise it will throw CastException.
Parameters:
value - The string value to be evaluated.
Returns:
Result of evaluation as a string.

evaluateVoid

void evaluateVoid(string value)
Evaluate a string as some R script.
Parameters:
value - The string value to be evaluated.

set

void set(string name, any value)
Set an R value.

The value type can be most EPL types. An exception is thown if the type is not supported.
Parameters:
name - Name of the R variable to set
value - The value to set name to.