Learn R Programming

ClassifyR (version 1.6.2)

nearestShrunkenCentroidPredictInterface: Interface for pamr.predict Function from pamr CRAN Package

Description

Restructures variables from ClassifyR framework to be compatible with pamr.predict definition.

Usage

"nearestShrunkenCentroidPredictInterface"(trained, test, ...) "nearestShrunkenCentroidPredictInterface"(trained, test, ..., verbose = 3)

Arguments

trained
An object of class pamrtrained.
test
Either a matrix or ExpressionSet containing the test data. For a matrix, the rows are features, and the columns are samples.
...
For the function with matrix dispatch, arguments passed to the function with ExpressionSet dispatch. For the function with ExpressionSet dispatch, arguemnts passed to pamr.predict.
verbose
A number between 0 and 3 for the amount of progress messages to give. This function only prints progress messages if the value is 3.

Value

A factor of predicted classes for the test data.

Details

This function is an interface between the ClassifyR framework and pamr.predict.

See Also

pamr.predict for the function that was interfaced to.

Examples

Run this code
  if(require(pamr))
  {
    # Samples in one class with differential expression to other class.
    genesMatrix <- sapply(1:25, function(geneColumn) c(rnorm(100, 9, 1)))
    genesMatrix <- cbind(genesMatrix, sapply(1:25, function(geneColumn)
                                 c(rnorm(75, 9, 1), rnorm(25, 14, 1))))
    classes <- factor(rep(c("Poor", "Good"), each = 25))
    
    fit <- nearestShrunkenCentroidTrainInterface(genesMatrix[, c(1:20, 26:45)], classes[c(1:20, 26:45)])
    nearestShrunkenCentroidPredictInterface(fit, genesMatrix[, c(21:25, 46:50)])
  }

Run the code above in your browser using DataLab