public class RJniEngine extends REngineAbstract implements REngine
Constructor and Description |
---|
RJniEngine() |
Modifier and Type | Method and Description |
---|---|
void |
commit()
Method to commit all the R instructions stored when not in autocommit
mode.
|
protected Object |
convertResult(org.rosuda.JRI.REXP rexp)
Convert the result from an R expression to a java object.
|
protected RDataFrame |
convertToDataFrame(org.rosuda.JRI.REXP rexp) |
protected RList |
convertToRList(org.rosuda.JRI.REXP rexp) |
Object |
eval(String expr)
Evaluate a R expression in R and get back the result.
|
Object |
evalScript(String expr)
Evaluate a R multi-line expression in R and get back the result.
|
boolean |
init()
Initialize the R engine.
|
void |
terminate()
Terminate the R connection.
|
void |
voidEval(String expr)
Evaluate a R expression in R without getting back the result.
|
clearSession, cp, dget, dget, dput, dput, getwd, isAutoCommit, loadRData, loadRData, loadRData, ls, mv, plot, remove, saveRData, saveRData, saveRData, setAutoCommit, setwd
public boolean init()
init
in interface REngine
REngine.init()
public Object eval(String expr) throws RException
eval
in interface REngine
expr
- the R expression to evaluate.RException
- if an error occur while trying to evaluate the
expression.REngine.eval(java.lang.String)
public Object evalScript(String expr) throws RException
evalScript
in interface REngine
expr
- the R expression to evaluate.RException
- if an error occur while trying to evaluate the
expression.REngine.eval(java.lang.String)
protected Object convertResult(org.rosuda.JRI.REXP rexp)
rexp
- the R expression to convert.protected RDataFrame convertToDataFrame(org.rosuda.JRI.REXP rexp)
protected RList convertToRList(org.rosuda.JRI.REXP rexp)
public void terminate()
terminate
in interface REngine
REngine.terminate()
public void voidEval(String expr) throws RException
voidEval
in interface REngine
expr
- the R expression to evaluate.RException
- if an error occured while trying to evaluate the
expression.REngine.voidEval(java.lang.String)
,
commit()
public void commit() throws RException
commit
in interface REngine
RException
- if an error occur while evaluating the
instructions in R.REngine.commit()
Copyright © 2006–2018 CodeLutin. All rights reserved.