Learn R Programming

ClassifyR (version 1.6.2)

subtractFromLocation: Subtract All Feature Measurements from Location

Description

For each feature, calculates the location, and subtracts all measurements from that location.

Usage

"subtractFromLocation"(expression, ...) "subtractFromLocation"(expression, training, location = c("mean", "median"), absolute = TRUE, verbose = 3)

Arguments

expression
Either a matrix or ExpressionSet containing the data. For a matrix, the rows are features, and the columns are samples.
...
Unused variables from the matrix method passed to the ExpressionSet method.
training
A vector specifying which samples are in the training set.
location
Character. Either "mean" or "median".
absolute
If TRUE, then absolute values of the differences are returned.
verbose
A number between 0 and 3 for the amount of progress messages to give. A higher number will produce more messages.

Value

An ExpressionSet of the same dimension that was input, with values subtracted from the location specified.

Details

Only the samples specified by training are used in the calculation of the location. To use all samples for calculation of the location, simply provide indices of all the samples.

Examples

Run this code
  subtractFromLocation(matrix(1:100, ncol = 10), training = 1:5, "median")

Run the code above in your browser using DataLab