Learn R Programming

ChemoSpec (version 5.0.88)

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
# NOT RUN {
require("lattice")
data(SrE.IR)
M <- sampleDistSpectra(SrE.IR, method = "cosine",
  main = "SrE.IR Spectral Angle Between Samples")

# }

Run the code above in your browser using DataLab