public final class RRuntime extends Object implements org.rosuda.JRI.RMainLoopCallbacks
| Modifier and Type | Class and Description |
|---|---|
static class |
RRuntime.RRuntimeState
The possible states of the runtime.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeGraphicsDevice()
Closes the graphics device, whatever it was.
|
void |
execute(String command)
Execute naked R code.
|
void |
executeFunction(String function,
String... arguments)
Executes the given function by name, with the specified arguments.
|
static RRuntime |
getInstance()
Gets the singleton instance of this class.
|
RRuntime.RRuntimeState |
getState()
Gets the current state of this runtime.
|
boolean |
isAvailable()
Checks whether the R engine is available for use.
|
void |
loadFileGraphicsDevice(File outputFile)
Loads the file graphics device, as a PNG in the specified file.
|
void |
loadJavaGraphicsDevice()
Loads the java graphics device.
|
void |
loadPackageDependency(String dependency)
Install and load a package.
|
void |
rBusy(org.rosuda.JRI.Rengine engine,
int stateEvent)
Indicate that the engine has changed its busy state.
|
String |
rChooseFile(org.rosuda.JRI.Rengine engine,
int newFile)
Choose file for use in console.
|
void |
rFlushConsole(org.rosuda.JRI.Rengine engine)
Flush any buffered output.
|
void |
rLoadHistory(org.rosuda.JRI.Rengine engine,
String historyFile)
Load the history from file.
|
String |
rReadConsole(org.rosuda.JRI.Rengine engine,
String consolePrompt,
int addToHistory)
Read text into the console.
|
void |
rSaveHistory(org.rosuda.JRI.Rengine engine,
String historyFile)
Save the history to file.
|
void |
rShowMessage(org.rosuda.JRI.Rengine engine,
String errorWarning)
Show warning/error text.
|
void |
rWriteConsole(org.rosuda.JRI.Rengine engine,
String outText,
int outputType)
Write text to the console.
|
void |
source(File sourceFile)
Reads and evaluates an R source file.
|
public static RRuntime getInstance()
public boolean isAvailable()
public RRuntime.RRuntimeState getState()
public void loadPackageDependency(String dependency)
dependency - The name of the package to be installed/loaded.public void loadFileGraphicsDevice(File outputFile)
outputFile - The file to write the PNG data to.public void loadJavaGraphicsDevice()
public void closeGraphicsDevice()
public void executeFunction(String function, String... arguments)
function - The name of the function to be executed.arguments - The arguments to the function to be executed.public void source(File sourceFile)
sourceFile - The R source file.public void execute(String command)
command - The R code to be executed.public void rWriteConsole(org.rosuda.JRI.Rengine engine,
String outText,
int outputType)
rWriteConsole in interface org.rosuda.JRI.RMainLoopCallbacksengine - The R engine.outText - The text to write out.outputType - Type of output. 0=Regular, 1=Error/Warning.public void rBusy(org.rosuda.JRI.Rengine engine,
int stateEvent)
rBusy in interface org.rosuda.JRI.RMainLoopCallbacksengine - The R engine.stateEvent - The type of event being indicated. 1=Busy, 0=NotBusypublic String rReadConsole(org.rosuda.JRI.Rengine engine, String consolePrompt, int addToHistory)
rReadConsole in interface org.rosuda.JRI.RMainLoopCallbacksengine - The R engine.consolePrompt - The console prompt text.addToHistory - Whether to add the returned output to the history. 0=No, !0=Yespublic void rShowMessage(org.rosuda.JRI.Rengine engine,
String errorWarning)
rShowMessage in interface org.rosuda.JRI.RMainLoopCallbacksengine - The R engine.errorWarning - The error/warning text.public String rChooseFile(org.rosuda.JRI.Rengine engine, int newFile)
rChooseFile in interface org.rosuda.JRI.RMainLoopCallbacksengine - The R engine.newFile - Whether a new or existing file is needed.public void rFlushConsole(org.rosuda.JRI.Rengine engine)
rFlushConsole in interface org.rosuda.JRI.RMainLoopCallbacksengine - The R engine.public void rSaveHistory(org.rosuda.JRI.Rengine engine,
String historyFile)
rSaveHistory in interface org.rosuda.JRI.RMainLoopCallbacksengine - The R engine.historyFile - The path of the history file to save.public void rLoadHistory(org.rosuda.JRI.Rengine engine,
String historyFile)
rLoadHistory in interface org.rosuda.JRI.RMainLoopCallbacksengine - The R engine.historyFile - The path of the history file to load.Copyright © 2016. All rights reserved.