Package adams.core
Class RDataHelper
- java.lang.Object
-
- adams.core.RDataHelper
-
public class RDataHelper extends Object
Helper class for R-related stuff.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description RDataHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static adams.data.spreadsheet.SpreadSheetdataframeToSpreadsheet(org.rosuda.REngine.REXP dframe)Converts the R dataframe into a spreadsheet.static adams.data.spreadsheet.SpreadSheetdataframeToSpreadsheet(org.rosuda.REngine.REXP dframe, String[] columns)Converts the R dataframe into a spreadsheet.protected static StringlistToString(org.rosuda.REngine.RList list)Turns anRListinto a string.static StringobjectToString(Object obj)Turns an R object into a string.static org.rosuda.REngine.REXPspreadsheetToDataframe(adams.data.spreadsheet.SpreadSheet sheet)Turns a spreadsheet into an R dataframe.
-
-
-
Method Detail
-
spreadsheetToDataframe
public static org.rosuda.REngine.REXP spreadsheetToDataframe(adams.data.spreadsheet.SpreadSheet sheet) throws org.rosuda.REngine.REXPMismatchExceptionTurns 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.REXPMismatchExceptionConverts 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.REXPMismatchExceptionConverts the R dataframe into a spreadsheet.- Parameters:
dframe- the dataframe to convertcolumns- 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 anRListinto a string.- Parameters:
list- the list to convert- Returns:
- the generated string
-
-