Package adams.core

Class RDataHelper


  • public class RDataHelper
    extends Object
    Helper class for R-related stuff.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • RDataHelper

        public RDataHelper()
    • Method Detail

      • spreadsheetToDataframe

        public static org.rosuda.REngine.REXP spreadsheetToDataframe​(adams.data.spreadsheet.SpreadSheet sheet)
                                                              throws org.rosuda.REngine.REXPMismatchException
        Turns a spreadsheet into an R dataframe.
        Parameters:
        sheet - the sheet to convert
        Returns:
        the dataframe object
        Throws:
        org.rosuda.REngine.REXPMismatchException
      • dataframeToSpreadsheet

        public static adams.data.spreadsheet.SpreadSheet dataframeToSpreadsheet​(org.rosuda.REngine.REXP dframe)
                                                                         throws org.rosuda.REngine.REXPMismatchException
        Converts the R dataframe into a spreadsheet.
        Parameters:
        dframe - the dataframe to convert
        Returns:
        the generated spreadsheet
        Throws:
        org.rosuda.REngine.REXPMismatchException
      • dataframeToSpreadsheet

        public static adams.data.spreadsheet.SpreadSheet dataframeToSpreadsheet​(org.rosuda.REngine.REXP dframe,
                                                                                String[] columns)
                                                                         throws org.rosuda.REngine.REXPMismatchException
        Converts the R dataframe into a spreadsheet.
        Parameters:
        dframe - the dataframe to convert
        columns - the list of columns to retrieve, null to retrieve all
        Returns:
        the generated spreadsheet
        Throws:
        org.rosuda.REngine.REXPMismatchException
      • listToString

        protected static String listToString​(org.rosuda.REngine.RList list)
        Turns an RList into a string.
        Parameters:
        list - the list to convert
        Returns:
        the generated string
      • objectToString

        public static String objectToString​(Object obj)
        Turns an R object into a string.
        Parameters:
        obj - the object to turn into a string
        Returns:
        the generated string