public interface RClient
Modifier and Type | Method and Description |
---|---|
void |
assign(String argName,
double[] arg) |
void |
assign(String arg0,
int[] arg1) |
void |
assign(String sym,
String ct) |
void |
assign(String argName,
String[] array) |
String |
assignFactor(List<String> strings) |
String |
assignFactor(String factorName,
List<String> list) |
String |
assignMatrix(double[][] matrix)
Assign a 2-d matrix.
|
String |
assignMatrix(DoubleMatrix<?,?> matrix)
Assign a 2-d matrix.
|
String |
assignMatrix(DoubleMatrix<?,?> matrix,
org.apache.commons.collections4.Transformer rowNameExtractor)
Assign a 2-d matrix.
|
String |
assignStringList(List<?> objects)
Define a variable corresponding to a character array in the R context, given a List of Strings.
|
boolean |
booleanDoubleArrayEval(String command,
String argName,
double[] arg)
Run a command that takes a double array as an argument and returns a boolean.
|
String |
dataFrame(ObjectMatrix<String,String,Object> matrix)
Convert an object matrix into an R data frame.
|
ObjectMatrix<String,String,Object> |
dataFrameEval(String command)
Evaluate a command that returns a dataFrame
|
double[] |
doubleArrayDoubleArrayEval(String command,
String argName,
double[] arg)
Run a command that has a single double array parameter, and returns a double array.
|
double[] |
doubleArrayEval(String command)
Run a command that returns a double array with no arguments.
|
double[] |
doubleArrayTwoDoubleArrayEval(String command,
String argName,
double[] arg,
String argName2,
double[] arg2)
Run a command that takes two double array arguments and returns a double array.
|
double |
doubleTwoDoubleArrayEval(String command,
String argName,
double[] arg,
String argName2,
double[] arg2)
Run a command that takes two double arrays as arguments and returns a double value.
|
org.rosuda.REngine.REXP |
eval(String command)
Evaluate the given command
|
String |
getLastError() |
int[] |
intArrayEval(String command) |
boolean |
isConnected() |
LinearModelSummary |
linearModel(double[] data,
Map<String,List<?>> factors)
Lower level access to linear model.
|
LinearModelSummary |
linearModel(double[] data,
ObjectMatrix<String,String,Object> design) |
List<?> |
listEval(Class<?> listEntryType,
String command) |
boolean |
loadLibrary(String libraryName) |
OneWayAnovaResult |
oneWayAnova(double[] data,
List<String> factor)
Lower-level access to a simple one-way ANOVA
|
Map<String,OneWayAnovaResult> |
oneWayAnovaEval(String command) |
void |
remove(String variableName)
Remove a variable from the R namespace
|
DoubleMatrix<String,String> |
retrieveMatrix(String variableName)
Get a matrix back out of the R context.
|
Map<String,LinearModelSummary> |
rowApplyLinearModel(String dataMatrixVarName,
String modelFormula,
String[] factorNames)
Run lm with anova on all the rows of a matrix
|
String |
stringEval(String command)
Evaluate any command and return a string
|
List<String> |
stringListEval(String command) |
TwoWayAnovaResult |
twoWayAnova(double[] data,
List<String> factor1,
List<String> factor2,
boolean includeInteraction)
Lower-level access to two-way ANOVA
|
Map<String,TwoWayAnovaResult> |
twoWayAnovaEval(String command,
boolean withInteractions)
Evaluates two way anova commands of the form
apply(matrix,1,function(x){anova(aov(x~farea+ftreat))}
and
apply(matrix,1,function(x){anova(aov(x~farea+ftreat+farea*ftreat))}
where farea and ftreat have already been transposed and had factor called on them.
|
void |
voidEval(String command) |
void assign(String argName, double[] arg)
argName
- arg
- void assign(String arg0, int[] arg1)
String assignFactor(List<String> strings)
strings
- String assignFactor(String factorName, List<String> list)
factorName
- list
- String assignMatrix(double[][] matrix)
matrix
- String assignMatrix(DoubleMatrix<?,?> matrix)
matrix
- String assignMatrix(DoubleMatrix<?,?> matrix, org.apache.commons.collections4.Transformer rowNameExtractor)
matrix
- rowNameExtractor
- String assignStringList(List<?> objects)
objects,
- which will be stringified if they are not strings.boolean booleanDoubleArrayEval(String command, String argName, double[] arg)
command
- argName
- arg
- String dataFrame(ObjectMatrix<String,String,Object> matrix)
matrix
- ObjectMatrix<String,String,Object> dataFrameEval(String command)
command
- double[] doubleArrayDoubleArrayEval(String command, String argName, double[] arg)
command
- argName
- arg
- double[] doubleArrayEval(String command)
command
- double[] doubleArrayTwoDoubleArrayEval(String command, String argName, double[] arg, String argName2, double[] arg2)
command
- argName
- arg
- argName2
- arg2
- double doubleTwoDoubleArrayEval(String command, String argName, double[] arg, String argName2, double[] arg2)
command
- argName
- arg
- argName2
- arg2
- org.rosuda.REngine.REXP eval(String command)
command
- String getLastError()
int[] intArrayEval(String command)
boolean isConnected()
LinearModelSummary linearModel(double[] data, Map<String,List<?>> factors)
data
- factors
- Map of factorNames to factors (which can be expressed as Strings or Doubles). If you care about
the order the factors are introduced into the model, use a LinkedHashMap.LinearModelSummary linearModel(double[] data, ObjectMatrix<String,String,Object> design)
data
- design
- which will be converted to factors or continuous covariates depending on whether the columns are
booleans, strings or numerical. Names of factors are the column names of the design matrix, and the rows
are assumed to be in the same order as the data.List<?> listEval(Class<?> listEntryType, String command)
listEntryType
- a hint about what type of object you want the list to contain. If you set this to be null,
the method will try to guess, but caution is advised.command
- R commandboolean loadLibrary(String libraryName)
OneWayAnovaResult oneWayAnova(double[] data, List<String> factor)
data
- factor
- Map<String,OneWayAnovaResult> oneWayAnovaEval(String command)
void remove(String variableName)
variableName
- DoubleMatrix<String,String> retrieveMatrix(String variableName)
variableName
- Map<String,LinearModelSummary> rowApplyLinearModel(String dataMatrixVarName, String modelFormula, String[] factorNames)
dataMatrixVarName
- from an assignment of a matrixmodelFormula
- and other options that will be passed as the argument to 'lm(...)', that refers to factor
variables that have already been assigned, using x as the outcome. Example might be x ~ f1 + f2.names
- of the factors like {"f1", "f2"}.String stringEval(String command)
command
- TwoWayAnovaResult twoWayAnova(double[] data, List<String> factor1, List<String> factor2, boolean includeInteraction)
data
- factor1
- factor2
- includeInteraction
- Map<String,TwoWayAnovaResult> twoWayAnovaEval(String command, boolean withInteractions)
apply(matrix,1,function(x){anova(aov(x~farea+ftreat))}
andapply(matrix,1,function(x){anova(aov(x~farea+ftreat+farea*ftreat))}
where farea and ftreat have already been transposed and had factor called on them.command
- void voidEval(String command)
Copyright © 2003–2022 UBC Michael Smith Laboratories. All rights reserved.