Class RTools
java.lang.Object
com.eco.bio7.rbridge.RTools
This class provides methods for the communication with the R
application.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcallRScript(String path) A method to call a RScript.static voidcallRScriptSilent(String path) A method to call a RScript without to capture (print) the output.static voidstatic voidstatic voidevaluateExt(String expression) Evaluates an R expression without running in a job.static intstatic StringgetRout()Internal method of Bio7.static String[]A method to get the selected variable names in the left Objects tab in the R-Shell view (variables in the R workspace!).static booleanisAlive()Returns if R is running.static booleanReturns if R is running, with a dialog if it isn't.static booleanReturns if Bio7 is connected to R.static booleanInternal method of Bio7.static booleanisPdf()Returns if the plotting device is the pdf device.static booleanReturns if R is running.static File[]ListFilesDirectory(File filedirectory, String[] extensions) static voidopenPDF(String plotPathR, String fileName, boolean useBrowser, String openInJavaFXBrowser, boolean delete, boolean activateProjectExplorer) static voidstatic voidEvaluates and prints an expression to the Bio7 console.static voidEvaluates and prints an expression to the Bio7 console executed in a job.static voidprintJobJoin(String expression) Evaluates and prints an expression to the Bio7 console executed in a job with job join.static voidEvaluates and prints an array of expressions to the Bio7 console executed in a job.static voidsetPdf(boolean pdf) Set the plotting device to pdf.static voidsetPlotInch(double inchx, double inchy) Set the plot size in inch for a pdf plot.static voidsetPlotPixel(int imageWidth, int imageHeight) Set the plot size in pixel for a png plot.static voidInternal method of Bio7.static voidsetRrunning(boolean running) Sets if R is running.
-
Constructor Details
-
RTools
public RTools()
-
-
Method Details
-
evaluateExt
Evaluates an R expression without running in a job. This method can be used to evaluate R scripts from e.g. Groovy (running already in a job). R plots a possible, too.- Parameters:
expression- a R expression.
-
printJob
Evaluates and prints an expression to the Bio7 console executed in a job.- Parameters:
expression- a R expression as a string.
-
printJobJoin
Evaluates and prints an expression to the Bio7 console executed in a job with job join.- Parameters:
expression- a R expression as a string.
-
printJobs
Evaluates and prints an array of expressions to the Bio7 console executed in a job.- Parameters:
expressions- a R expression as a string.
-
print
Evaluates and prints an expression to the Bio7 console.- Parameters:
expression- a R expression as a string.
-
isAliveDialog
public static boolean isAliveDialog()Returns if R is running, with a dialog if it isn't.- Returns:
- a boolean value.
-
isAlive
public static boolean isAlive()Returns if R is running.- Returns:
- a boolean value.
-
isPdf
public static boolean isPdf()Returns if the plotting device is the pdf device.- Returns:
- a boolean value.
-
setPdf
public static void setPdf(boolean pdf) Set the plotting device to pdf.- Parameters:
pdf- a boolean value.
-
isIsconnecting
public static boolean isIsconnecting()Internal method of Bio7.- Returns:
- a boolean value.
-
isRrunning
public static boolean isRrunning()Returns if R is running.- Returns:
- a boolean value.
-
setRrunning
public static void setRrunning(boolean running) Sets if R is running.- Parameters:
running- a boolean value.
-
setRout
-
getRout
-
isConnected
public static boolean isConnected()Returns if Bio7 is connected to R.- Returns:
- a boolean value.
-
setPlotInch
public static void setPlotInch(double inchx, double inchy) Set the plot size in inch for a pdf plot.- Parameters:
inchx- the width of the plot in inch units.inchy- the height of the plot in inch units.
-
setPlotPixel
public static void setPlotPixel(int imageWidth, int imageHeight) Set the plot size in pixel for a png plot.- Parameters:
imageWidth- the width of the plot in pixel units.imageHeight- the height of the plot in pixel units.
-
callRScript
A method to call a RScript.- Parameters:
path- the relative path from the Bio7 Workspace to the script.
-
callRScriptSilent
A method to call a RScript without to capture (print) the output.- Parameters:
path- the relative path from the Bio7 Workspace to the script.
-
getShellSelections
A method to get the selected variable names in the left Objects tab in the R-Shell view (variables in the R workspace!).- Returns:
- the selected workspace variables.
-
closeAndDisplay
public static void closeAndDisplay() -
closeAndDisplayNoJoin
public static void closeAndDisplayNoJoin() -
openPDF
public static void openPDF(String plotPathR, String fileName, boolean useBrowser, String openInJavaFXBrowser, boolean delete, boolean activateProjectExplorer) - Parameters:
String- plotPathR. A file pathString- fileName the file nameboolean- useBrowser if an internal or external browser should be usedboolean- openInJavaFXBrowser if the JavaFX browser component should be usedboolean- delete if the temporary file should be deletedboolean- activateProjectExplorer if the Project Explorer should be activated again (to click multiple files- used in the Project Explorer!)
-
getDisplayNumber
public static int getDisplayNumber() -
ListFilesDirectory
-
plotLinux
-