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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidStores an array in a R variable.Vector<org.rosuda.JRI.REXP>Executes the command(s) in R.static RConnectionImplprotected voidInitializes the connection to a R engine.static booleanchecks 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:RConnectionExecutes the command(s) in R.- Specified by:
executein 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:RConnectionStores an array in a R variable.- Specified by:
assignin 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:
trueif the connection is established.
-
getRConnection
- Returns:
- returns the current RConnection.
-
getLastConsoleMessage
- Specified by:
getLastConsoleMessagein interfaceRConnection- Returns:
- the last message on the console of the connected R engine.
-