Interface RContext

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void assign​(String var, Object value)
      Assigns a value to a variable in R.
      REXP eval​(String expr)
      Parses and evaluates an R expression and returns the result.
      REXP get​(String var)
      Retreives a value from R
      String[] names​(String var)
      Often in R, results have a 'names' attribute, for example the parameter names in an lm() regression
      void plot​(String expr, String fileName)
      Future functionality - Not yet implemented!
      String print​(String var)
      When evaluating an expression in R some output may be printed as a side effect, such as by lm().
    • Method Detail

      • eval

        REXP eval​(String expr)
        Parses and evaluates an R expression and returns the result. An expression can be as short as or as long as needed (i.e. a whole script).
        Parameters:
        expr - The expression, as string, to evaluate
        Returns:
        The resulting expression or null in case of an error
      • get

        REXP get​(String var)
        Retreives a value from R
        Parameters:
        var - The variable to retreive the value from
        Returns:
        The resulting expression
      • names

        String[] names​(String var)
        Often in R, results have a 'names' attribute, for example the parameter names in an lm() regression
        Parameters:
        var - The variable to retreive the names from
        Returns:
        The names array, or null if there is no such attribute
      • print

        String print​(String var)
        When evaluating an expression in R some output may be printed as a side effect, such as by lm(). While not structured data, it may be useful to capture this output to show as a calculation result in the UI, or merely for logging purposes.
        Parameters:
        var - The variable to print, i.e. where that expression was assigned to
        Returns:
        The printed output as a string
      • plot

        void plot​(String expr,
                  String fileName)
        Future functionality - Not yet implemented!
        Parameters:
        expr -
        fileName -