public class RProxy extends Object implements REngine
-DR.type=net-DR.type=jni-DR.type=...RNetEngine documentation.| Constructor and Description |
|---|
RProxy()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
Object |
evalScript(String expr)
Send a R multi-line 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
|
boolean |
isJni()
To know if the engine interfaced is a RJniEngine.
|
boolean |
isNet()
To know if the engine interfaced is a RNetEngine.
|
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 |
plot(String filename,
String x,
String y,
String type,
String main,
String sub,
String xlab,
String ylab,
String asp) |
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.
|
public RProxy()
throws RException
RException - if initialisation failedpublic 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(String)public Object evalScript(String expr) throws RException
evalScript in interface REngineexpr - the R instruction to send.RException - if an error occur while trying to evaluate the
expression.REngine.eval(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(String)public void loadRData(File directory) throws RException
loadRData in interface REnginedirectory - directory where the .RData file is locatedRException - if an error occcur while loading the R session.REngine.loadRData(File),
REngineAbstract.loadRData(File)public void saveRData(File directory) throws RException
saveRData in interface REnginedirectory - where the .RData file will be savedRException - if an error occur while saving the R session.REngine.saveRData(File),
REngineAbstract.saveRData(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(File),
REngineAbstract.setwd(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 saveRException - if an error occur while saving the content of the
object.REngine.dput(String, String),
REngineAbstract.dput(String, 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 loadRException - if an error occur while trying to perform this
operation.REngine.dget(String, String),
REngineAbstract.dget(String, String)public void dput(String rObject, File outputFile) throws RException
dput in interface REnginerObject - R object to saveoutputFile - the file to saveRException - if an error occur while performing the operation.REngine.dput(String, File),
REngineAbstract.dput(String, File)public void dget(String rObject, File inputFile) throws RException
dget in interface REnginerObject - name of the R object createdinputFile - file to loadRException - if an eroor occur while performing the operation.REngine.dget(String, File),
REngineAbstract.dget(String, 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(String),
REngineAbstract.remove(String)public void mv(String source, String destination) throws RException
mv in interface REnginesource - the source R object namedestination - the destination R object nameRException - if an error occur while renaming the R
object.REngine.mv(String, String),
REngineAbstract.mv(String, String)public void cp(String inputObject, String outputObject) throws RException
cp in interface REngineinputObject - the source R object naameoutputObject - the destination R object nameRException - if an error occur while copying the R
object.REngine.cp(String, String),
REngineAbstract.cp(String, 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 modeRException - if an error occur while switching
modes.REngine.setAutoCommit(Boolean),
REngine.setAutoCommit(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(File, String),
REngineAbstract.saveRData(File, 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(File, String),
REngineAbstract.loadRData(File, String)public void saveRData(String filename) throws RException
REnginesaveRData in interface REngineRExceptionpublic void loadRData(String filename) throws RException
REngineloadRData in interface REnginefilename - name of the .RData file (will be followed by .RData)RExceptionpublic void plot(String filename, String x, String y, String type, String main, String sub, String xlab, String ylab, String asp) throws RException
plot in interface REngineRExceptionpublic boolean isNet()
public boolean isJni()
Copyright © 2006–2018 CodeLutin. All rights reserved.