|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.af.jhlir.tools.RCmdBatch
public class RCmdBatch
Execute R in batch mode. Use this to query R for information / set up stuff / install packages, before you can properly connect to it through jhlir. Don't rely on this class too much and try to connect to R properly as aerly as possibly as error recognition and handling is shaky, as one can only use the textual output of the R batch script. Only prerequisite to invoke this class is knowledge of the path to R_HOME.
| Field Summary | |
|---|---|
static String[] |
R_ARGS
|
| Constructor Summary | |
|---|---|
RCmdBatch(File rHome)
Constructor |
|
RCmdBatch(String rHome)
Constructor |
|
| Method Summary | |
|---|---|
List<String> |
exec(List<String> input)
Excecute a list of R commands in batch mode. |
List<String> |
getInstalledPackages()
Retrieves all installed R packages on the library paths. |
RPackage |
getInstalledPackInfo(String pack)
Retrieve information about an installed R package on the current library paths. |
String |
getLibPaths()
Get the R lib paths, separated by the path separator of your platform. |
String |
getRVersion()
Get R version as a String. |
RPackage |
installCranPackage(String pack)
Installs an R package from CRAN into the defaullt library directory. |
RPackage |
installCranPackage(String pack,
File where)
Installs an R package from CRAN. |
RPackage |
installRForgePackage(String pack)
Installs an R package from R-Forge into the defaullt library directory. |
RPackage |
installRForgePackage(String pack,
File where)
Installs an R package from R-Forge. |
boolean |
isInstalled(String pack)
Check whether an R package was installed on the current library paths. |
Map<String,String> |
retrieveInfo(List<String> input,
List<String> vars)
Excecute a list of R commands in batch mode and return the contents of R variables as strings. |
String |
retrieveInfo(List<String> input,
String var)
Excecute a list of R commands in batch mode and return the content of a R variable as a string. |
void |
retrieveRInfo()
Collects information of the used R engine and stores it in this object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String[] R_ARGS
| Constructor Detail |
|---|
public RCmdBatch(File rHome)
rHome - R Home directory.public RCmdBatch(String rHome)
rHome - Absolute Path to R Home directory.| Method Detail |
|---|
public List<String> exec(List<String> input)
throws RCmdBatchException
input - List of R commonds
RCmdBatchException - In case of IO errors or general errors with the R CMD BATCH process. Underlying exceptions are encapsulated as causing exceptions.
public String retrieveInfo(List<String> input,
String var)
throws RCmdBatchException
input - List of R commandsvar - R variable you want to retrieve.
RCmdBatchException - In case of IO errors or general errors with the R CMD BATCH process. Underlying exceptions are encapsulated as causing exceptions.
public Map<String,String> retrieveInfo(List<String> input,
List<String> vars)
throws RCmdBatchException
input - List of R commandsvars - R variables you want to retrieve.
RCmdBatchException - In case of IO errors or general errors with the R CMD BATCH process. Underlying exceptions are encapsulated as causing exceptions.
public RPackage getInstalledPackInfo(String pack)
throws RCmdBatchException
pack - R package name.
RCmdBatchException - See exec(java.util.List) .
public boolean isInstalled(String pack)
throws RCmdBatchException
pack - R package name.
RCmdBatchException - See exec(java.util.List) .
public List<String> getInstalledPackages()
throws RCmdBatchException
RCmdBatchException - See exec(java.util.List) .
public RPackage installCranPackage(String pack)
throws CantFindPackageException,
RCmdBatchException
pack - R package to install.
CantFindPackageException - If the package is not available on CRAN.
RCmdBatchException - See exec(java.util.List) .
public RPackage installCranPackage(String pack,
File where)
throws CantFindPackageException,
RCmdBatchException
pack - R package to install.where - Directory to install the package into.
CantFindPackageException - If the package is not available on CRAN.
RCmdBatchException - See exec(java.util.List) .
public RPackage installRForgePackage(String pack)
throws CantFindPackageException,
RCmdBatchException
pack - R package to install.
CantFindPackageException - If the package is not available on R-Forge.
RCmdBatchException - See exec(java.util.List) .
public RPackage installRForgePackage(String pack,
File where)
throws CantFindPackageException,
RCmdBatchException
pack - R package to install.where - Directory to install the package into.
CantFindPackageException - If the package is not available on R-Forge.
RCmdBatchException - See exec(java.util.List) .
public void retrieveRInfo()
throws RCmdBatchException
RCmdBatchExceptionthis.getRVersion,
this.getLibPathspublic String getRVersion()
public String getLibPaths()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||