Class RTools

java.lang.Object
com.eco.bio7.rbridge.RTools

public class RTools extends Object
This class provides methods for the communication with the R application.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    A method to call a RScript.
    static void
    A method to call a RScript without to capture (print) the output.
    static void
     
    static void
     
    static void
    evaluateExt(String expression)
    Evaluates an R expression without running in a job.
    static int
     
    static String
    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 boolean
    Returns if R is running.
    static boolean
    Returns if R is running, with a dialog if it isn't.
    static boolean
    Returns if Bio7 is connected to R.
    static boolean
    Internal method of Bio7.
    static boolean
    Returns if the plotting device is the pdf device.
    static boolean
    Returns if R is running.
    static File[]
    ListFilesDirectory(File filedirectory, String[] extensions)
     
    static void
    openPDF(String plotPathR, String fileName, boolean useBrowser, String openInJavaFXBrowser, boolean delete, boolean activateProjectExplorer)
     
    static void
    plotLinux(String finalpath)
     
    static void
    print(String expression)
    Evaluates and prints an expression to the Bio7 console.
    static void
    printJob(String expression)
    Evaluates and prints an expression to the Bio7 console executed in a job.
    static void
    printJobJoin(String expression)
    Evaluates and prints an expression to the Bio7 console executed in a job with job join.
    static void
    printJobs(String[] expressions)
    Evaluates and prints an array of expressions to the Bio7 console executed in a job.
    static void
    setPdf(boolean pdf)
    Set the plotting device to pdf.
    static void
    setPlotInch(double inchx, double inchy)
    Set the plot size in inch for a pdf plot.
    static void
    setPlotPixel(int imageWidth, int imageHeight)
    Set the plot size in pixel for a png plot.
    static void
    Internal method of Bio7.
    static void
    setRrunning(boolean running)
    Sets if R is running.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RTools

      public RTools()
  • Method Details

    • evaluateExt

      public static void evaluateExt(String expression)
      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

      public static void printJob(String expression)
      Evaluates and prints an expression to the Bio7 console executed in a job.
      Parameters:
      expression - a R expression as a string.
    • printJobJoin

      public static void printJobJoin(String expression)
      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

      public static void printJobs(String[] expressions)
      Evaluates and prints an array of expressions to the Bio7 console executed in a job.
      Parameters:
      expressions - a R expression as a string.
    • print

      public static void print(String expression)
      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

      public static void setRout(String rout)
      Internal method of Bio7.
      Parameters:
      rout - a string value.
    • getRout

      public static String getRout()
      Internal method of Bio7.
      Returns:
      a string value.
    • 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

      public static void callRScript(String path)
      A method to call a RScript.
      Parameters:
      path - the relative path from the Bio7 Workspace to the script.
    • callRScriptSilent

      public static void callRScriptSilent(String path)
      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

      public static String[] 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 path
      String - fileName the file name
      boolean - useBrowser if an internal or external browser should be used
      boolean - openInJavaFXBrowser if the JavaFX browser component should be used
      boolean - delete if the temporary file should be deleted
      boolean - activateProjectExplorer if the Project Explorer should be activated again (to click multiple files- used in the Project Explorer!)
    • getDisplayNumber

      public static int getDisplayNumber()
    • ListFilesDirectory

      public static File[] ListFilesDirectory(File filedirectory, String[] extensions)
    • plotLinux

      public static void plotLinux(String finalpath)