Learn R Programming

ChemoSpec (version 4.3.34)

sampleDistSpectra: Compute the Distance Between Samples in a Spectra Object

Description

Compute the Distance between samples in a Spectra object. This is a means to quantify the similarity between samples. A heat map style plot is an option.

Usage

sampleDistSpectra(spectra, method = "pearson", plot = TRUE, ...)

Arguments

spectra
An object of S3 class Spectra.
method
Character. A string giving the distance method. See rowDist for options.
plot
Logical. Shall a level plot be made?
...
Arguments to be passed to the plotting function.

Value

A numeric matrix giving the correlation coefficients.

References

https://github.com/bryanhanson/ChemoSpec

See Also

The sample distances can be used to cluster the samples. See for example hcaSpectra.

Examples

Run this code
require("lattice")
data(metMUD2)
sampleDistSpectra(metMUD2, main = "Sample Correlations for metMUD2")

Run the code above in your browser using DataLab