|
||||||||||
| 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(String inputObject,
String outputObject)
Method similar to the linux cp command : copy a R object. |
void |
dget(String rObject,
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(String rObject,
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(String rObject,
File outputFile)
Use the dput R instruction to store the content of a R object to a file. |
void |
dput(String rObject,
String outputFileName)
Use the dput R instruction to store the content of a R object to a file. |
Object |
eval(String expr)
Send a R instruction to the engine and get the result back. |
File |
getwd()
Get the actual R session working directory |
boolean |
init()
Get back the R engine type options to initialize the REngine. |
Boolean |
isAutoCommit()
Method to know the autocommit mode : true : autocommit mode false : non-autocommit mode |
void |
loadRData(File directory)
Load .RData file located in directory |
void |
loadRData(File directory,
String fileName)
Load a specific R session : Load the "fileName.RData" file located in directory. |
void |
loadRData(String filename)
Load filename.RData file located in current working directory |
String[] |
ls()
Method to get all the R objects present in session. |
void |
mv(String source,
String destination)
Method similar to the linux mv command : rename a R object. |
void |
remove(String rObject)
Remove an object from the R session using the remove(rObject) R function. |
void |
saveRData(File directory)
Save the session in a .RData file in directory |
void |
saveRData(File directory,
String fileName)
Save a R session in a fileName.RData file located in directory. |
void |
saveRData(String filename)
Save a R session in a filename.RData file located in the current working directory |
void |
setAutoCommit(Boolean autocommit)
Method to set the autocommit mode : true : autocommit mode false : non-autocommit mode |
void |
setwd(File directory)
Set the R working directory |
void |
terminate()
Terminate the R engine. |
void |
voidEval(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()
throws RException
RException - if initialisation failed| Method Detail |
|---|
public Object eval(String expr)
throws RException
eval in interface REngineexpr - the R instruction to send.
RException - if an error occur while trying to evaluate the
expression.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(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(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(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(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 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(String rObject,
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(String rObject,
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(String rObject,
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(String rObject,
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(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(String source,
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(String inputObject,
String outputObject)
throws RException
cp in interface REngineinputObject - the source R object naameoutputObject - 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 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(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 Boolean isAutoCommit()
isAutoCommit in interface REngineREngine.isAutoCommit(),
REngineAbstract.isAutoCommit()
public void saveRData(File directory,
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(File directory,
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)
public void saveRData(String filename)
throws RException
REngine
saveRData in interface REngineRException
public void loadRData(String filename)
throws RException
REngine
loadRData in interface REnginefilename - name of the .RData file (will be followed by .RData)
RException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||