|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.j2r.RProxy
public class RProxy
This class allows to initialize a REngine without knowing which implementation is chosen. The implementation detection is based on the JVM's options :
-DR.type=net-DR.type=jni-DR.type=...RNetEngine documentation.
| Constructor Summary | |
|---|---|
RProxy()
Constructor. |
|
| Method Summary | |
|---|---|
void |
clearSession()
Method to remove all objects from the R session. |
void |
commit()
Method to launch the evaluation of all the R expressions stored when in non-autocommit mode. |
void |
cp(java.lang.String inputObject,
java.lang.String outputObject)
Method similar to the linux cp command : copy a R object. |
void |
dget(java.lang.String rObject,
java.io.File inputFile)
Use the dget R instruction to store the content of a file (created with the dput instruction) into a R object. |
void |
dget(java.lang.String rObject,
java.lang.String inputFileName)
Use the dget R instruction to store the content of a file (created with the dput R instruction) into a R object. |
void |
dput(java.lang.String rObject,
java.io.File outputFile)
Use the dput R instruction to store the content of a R object to a file. |
void |
dput(java.lang.String rObject,
java.lang.String outputFileName)
Use the dput R instruction to store the content of a R object to a file. |
java.lang.Object |
eval(java.lang.String expr)
Send a R instruction to the engine and get the result back. |
java.io.File |
getwd()
Get the actual R session working directory |
boolean |
init()
Get back the R engine type options to initialize the REngine. |
java.lang.Boolean |
isAutoCommit()
Method to know the autocommit mode : true : autocommit mode false : non-autocommit mode |
void |
loadRData(java.io.File directory)
Load .RData file located in directory |
void |
loadRData(java.io.File directory,
java.lang.String fileName)
Load a specific R session : Load the "fileName.RData" file located in directory. |
java.lang.String[] |
ls()
Method to get all the R objects present in session. |
void |
mv(java.lang.String source,
java.lang.String destination)
Method similar to the linux mv command : rename a R object. |
void |
remove(java.lang.String rObject)
Remove an object from the R session using the remove(rObject) R function. |
void |
saveRData(java.io.File directory)
Save the session in a .RData file in directory |
void |
saveRData(java.io.File directory,
java.lang.String fileName)
Save a R session in a fileName.RData file located in directory. |
void |
setAutoCommit(java.lang.Boolean autocommit)
Method to set the autocommit mode : true : autocommit mode false : non-autocommit mode |
void |
setwd(java.io.File directory)
Set the R working directory |
void |
terminate()
Terminate the R engine. |
void |
voidEval(java.lang.String expr)
Send a R instruction to the engine without getting back its result. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RProxy()
| Method Detail |
|---|
public java.lang.Object eval(java.lang.String expr)
throws RException
eval in interface REngineexpr - the R instruction to send.
RException - if an error occur while trying to evaluate the
expression.org.nuiton.R.REngine#eval(java.lang.String)public boolean init()
init in interface REngineREngine.init()
public void terminate()
throws RException
terminate in interface REngineRExceptionREngine.terminate()
public void voidEval(java.lang.String expr)
throws RException
voidEval in interface REngineexpr - the R instruction to send.
RException - if an error occured while trying to evaluate the
expression.REngine.voidEval(java.lang.String)
public void loadRData(java.io.File directory)
throws RException
loadRData in interface REnginedirectory - directory where the .RData file is located
RException - if an error occcur while loading the R session.REngine.loadRData(java.io.File),
REngineAbstract.loadRData(java.io.File)
public void saveRData(java.io.File directory)
throws RException
saveRData in interface REnginedirectory - where the .RData file will be saved
RException - if an error occur while saving the R session.REngine.saveRData(java.io.File),
REngineAbstract.saveRData(java.io.File)
public void setwd(java.io.File directory)
throws RException
setwd in interface REnginedirectory - the new working directory to set.
RException - if an error occur while setting the R working directory.REngine.setwd(java.io.File),
REngineAbstract.setwd(java.io.File)
public java.io.File getwd()
throws RException
getwd in interface REngineRException - if an error occur while getting the R working directory.REngine.getwd(),
REngineAbstract.getwd()
public void dput(java.lang.String rObject,
java.lang.String outputFileName)
throws RException
dput in interface REnginerObject - name of the R object to saveoutputFileName - name of the file to save
RException - if an error occur while saving the content of the
object.REngine.dput(java.lang.String, java.lang.String),
REngineAbstract.dput(java.lang.String, java.lang.String)
public void dget(java.lang.String rObject,
java.lang.String inputFileName)
throws RException
dget in interface REnginerObject - name of the R object createdinputFileName - name of the file to load
RException - if an error occur while trying to perform this
operation.REngine.dget(java.lang.String, java.lang.String),
REngineAbstract.dget(java.lang.String, java.lang.String)
public void dput(java.lang.String rObject,
java.io.File outputFile)
throws RException
dput in interface REnginerObject - R object to saveoutputFile - the file to save
RException - if an error occur while performing the operation.REngine.dput(java.lang.String, java.io.File),
REngineAbstract.dput(java.lang.String, java.io.File)
public void dget(java.lang.String rObject,
java.io.File inputFile)
throws RException
dget in interface REnginerObject - name of the R object createdinputFile - file to load
RException - if an eroor occur while performing the operation.REngine.dget(java.lang.String, java.io.File),
REngineAbstract.dget(java.lang.String, java.io.File)
public void remove(java.lang.String rObject)
throws RException
remove in interface REnginerObject - name of the R object to remove.
RException - if an error occur while removing the R
object.REngine.remove(java.lang.String),
REngineAbstract.remove(java.lang.String)
public void mv(java.lang.String source,
java.lang.String destination)
throws RException
mv in interface REnginesource - the source R object namedestination - the destination R object name
RException - if an error occur while renaming the R
object.REngine.mv(java.lang.String, java.lang.String),
REngineAbstract.mv(java.lang.String, java.lang.String)
public void cp(java.lang.String inputObject,
java.lang.String outputObject)
throws RException
cp in interface REnginesource - the source R object naamedestination - the destination R object name
RException - if an error occur while copying the R
object.REngine.cp(java.lang.String, java.lang.String),
REngineAbstract.cp(java.lang.String, java.lang.String)
public java.lang.String[] ls()
throws RException
ls in interface REngineRException - if an error occur while getting back
the objects list.REngine.ls(),
REngineAbstract.ls()
public void clearSession()
throws RException
clearSession in interface REngineRException - if an error occur while clearing the R
session.REngine.clearSession(),
REngineAbstract.clearSession()
public void commit()
throws RException
commit in interface REngineRException - if an error occur while evaluating one
of the R expressions.REngine.commit(),
REngine.commit()
public void setAutoCommit(java.lang.Boolean autocommit)
throws RException
setAutoCommit in interface REngineautocommit - the autocommit mode
RException - if an error occur while switching
modes.REngine.setAutoCommit(java.lang.Boolean),
REngine.setAutoCommit(java.lang.Boolean)public java.lang.Boolean isAutoCommit()
isAutoCommit in interface REngineREngine.isAutoCommit(),
REngineAbstract.isAutoCommit()
public void saveRData(java.io.File directory,
java.lang.String fileName)
throws RException
saveRData in interface REnginedirectory - where the ".RData" file will be locatedfileName - name of the file to save (will save in the fileName.RData
file)
RException - if an error occur while saving the R
session.REngine.saveRData(java.io.File, java.lang.String),
REngineAbstract.saveRData(java.io.File, java.lang.String)
public void loadRData(java.io.File directory,
java.lang.String fileName)
throws RException
loadRData in interface REnginedirectory - directory where the ".RData" file is locatedfileName - name of the file to load (will load the fileName.RData
file)
RException - if an error occur while loading the R
session file.REngine.loadRData(java.io.File, java.lang.String),
REngineAbstract.loadRData(java.io.File, java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||