Learn R Programming

ChemoSpec (version 4.0.1)

getMaxCovByFreq: Order Rows of a Covariance Matrix by Absolute Value

Description

Given a covariance matrix, the maximum absolute value of each row is computed. The results are ordered, and optionally, limited to values greater than a particular value.

Usage

getMaxCovByFreq(spectra, V = NULL, Quan = NULL)

Arguments

spectra
An object of S3 class Spectra.
V
A numeric covariance matrix.
Quan
Numeric. A value in the interval (0...1) giving the quantile to be selected. For instance, Quan = 0.1 selects the top 10 percent of values.

Value

  • A data frame containing the frequencies from the Spectra object, the absolute value of the covariance at that frequency, and the relative covariance. Sorted by absolute covariance in descending order.

References

https://github.com/bryanhanson/ChemoSpec

Examples

Run this code
data(metMUD1)
V <- cov(metMUD1$data)
# Look at the top 1%
res <- getMaxCovByFreq(metMUD1, V, Quan = 0.01)
res

Run the code above in your browser using DataLab