adams.core
Class RDataHelper

java.lang.Object
  extended by adams.core.RDataHelper

public class RDataHelper
extends Object

Helper class for R-related stuff.

Version:
$Revision: 6626 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Constructor Summary
RDataHelper()
           
 
Method Summary
static SpreadSheet dataframeToSpreadsheet(org.rosuda.REngine.REXP dframe)
          Converts the R dataframe into a spreadsheet.
static SpreadSheet dataframeToSpreadsheet(org.rosuda.REngine.REXP dframe, String[] columns)
          Converts the R dataframe into a spreadsheet.
protected static String listToString(org.rosuda.REngine.RList list)
          Turns an RList into a string.
static String objectToString(Object obj)
          Turns an R object into a string.
static org.rosuda.REngine.REXP spreadsheetToDataframe(SpreadSheet sheet)
          Turns a spreadsheet into an R dataframe.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDataHelper

public RDataHelper()
Method Detail

spreadsheetToDataframe

public static org.rosuda.REngine.REXP spreadsheetToDataframe(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 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 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


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.