Class RConnectionImpl
java.lang.Object
de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.utils.RConnectionImpl
- All Implemented Interfaces:
RConnection
Encapsulate the access to the R engine. Is responsible for the initialization of the R engine and
the execution of R commands.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Stores an array in a R variable.Vector<org.rosuda.JRI.REXP>
Executes the command(s) in R.static RConnectionImpl
protected void
Initializes the connection to a R engine.static boolean
checks if an R engine could be found and the connection is established.
-
Constructor Details
-
RConnectionImpl
public RConnectionImpl()Initializes the connection to the R engine.
-
-
Method Details
-
initalizeConnection
protected void initalizeConnection()Initializes the connection to a R engine. -
execute
Description copied from interface:RConnection
Executes the command(s) in R.- Specified by:
execute
in interfaceRConnection
- Parameters:
rCommands
- One or more valid commands in R, separated by\n
.- Returns:
- result Result returned from R. Empty if no result was returned.
-
assign
Description copied from interface:RConnection
Stores an array in a R variable.- Specified by:
assign
in interfaceRConnection
- Parameters:
name
- Name of the R variable in which the array is stored.array
- Array to store in an R variable.
-
isEngineAvailable
public static boolean isEngineAvailable()checks if an R engine could be found and the connection is established.- Returns:
true
if the connection is established.
-
getRConnection
- Returns:
- returns the current RConnection.
-
getLastConsoleMessage
- Specified by:
getLastConsoleMessage
in interfaceRConnection
- Returns:
- the last message on the console of the connected R engine.
-