getLocationsAndScales {ClassifyR} | R Documentation

## Calculate Location and Scale

### Description

Calculates the location and scale for each feature.

### Usage

      ## S4 method for signature 'matrix'
    getLocationsAndScales(measurements, ...)
      ## S4 method for signature 'DataFrame'
    getLocationsAndScales(measurements, location = c("mean", "median"),
                          scale = c("SD", "MAD", "Qn"))
      ## S4 method for signature 'MultiAssayExperiment'
    getLocationsAndScales(measurements, targets = names(measurements), ...)

### Arguments

`measurements` | Either a `matrix`, `DataFrame` or `MultiAssayExperiment` containing the data. For a `matrix`, the rows are features, and the columns are samples.
`targets` | If `measurements` is a `MultiAssayExperiment`, the names of the data tables to be used. `"clinical"` is also a valid value and specifies that numeric variables from the clinical data table will be used.
`...` | Variables not used by the `matrix` nor the `MultiAssayExperiment` method which are passed into and used by the `DataFrame` method.
`location` | The type of location to be calculated.
`scale` | The type of scale to be calculated.

### Details

`"SD"` is used to represent standard deviation and `"MAD"` is used to represent median absolute deviation.

### Value

A `list` of length 2. The first element contains the location for every feature. The second element contains the scale for every feature.

### Author(s)

Dario Strbenac

### References

Qn: http://www.tandfonline.com/doi/pdf/10.1080/01621459.1993.10476408

### Examples

      genesMatrix <- matrix(rnorm(1000, 8, 4), ncol = 10)
      distributionInfo <- getLocationsAndScales(genesMatrix, "median", "MAD")

      mean(distributionInfo[["median"]]) # Typical median.
      mean(distributionInfo[["MAD"]]) # Typical MAD.

[Package ClassifyR version 2.8.0 Index]