Skip to contents

Perform random forest on an AnalysisData object

Usage

randomForest(
  x,
  cls = "class",
  rf = list(),
  reps = 1,
  binary = FALSE,
  comparisons = list(),
  perm = 0,
  returnModels = FALSE,
  seed = 1234
)

# S4 method for AnalysisData
randomForest(
  x,
  cls = "class",
  rf = list(),
  reps = 1,
  binary = FALSE,
  comparisons = list(),
  perm = 0,
  returnModels = FALSE,
  seed = 1234
)

Arguments

x

S4 object of class AnalysisData

cls

vector of sample information columns to use for response variable information. Set to NULL for unsupervised.

rf

named list of arguments to pass to randomForest::randomForest

reps

number of repetitions to perform

binary

TRUE/FALSE should binary comparisons be performed. Ignored for unsupervised and regression. Ignored if comparisons specified.

comparisons

list of comparisons to perform. Ignored for unsupervised and regression. See details.

perm

number of permutations to perform. Ignored for unsupervised.

returnModels

TRUE/FALSE should model objects be returned.

seed

random number seed

Value

An S4 object of class RandomForest.

Details

Specified class comparisons should be given as a list named according to cls. Comparisons should be given as class names separated by '~' (eg. '1~2~H').

Examples

library(metaboData)

x <- analysisData(abr1$neg[,200:300],abr1$fact) %>%
       occupancyMaximum(cls = 'day') %>%
       transformTICnorm()
       
rf <- randomForest(x,cls = 'day')

plotMDS(rf,cls = 'day')