Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hcaSpectra

Plot HCA Results of a Spectra Object


Description

A wrapper which carries out HCA and plots a dendrogram colored by the information in a Spectra object. Many methods for computing the clusters and distances are available.

Usage

hcaSpectra(
  spectra,
  c.method = "complete",
  d.method = "euclidean",
  use.sym = FALSE,
  leg.loc = "topright",
  ...
)

Arguments

spectra

An object of S3 class Spectra.

c.method

A character string describing the clustering method; must be acceptable to hclust.

d.method

A character string describing the distance calculation method; must be acceptable as a method in rowDist.

use.sym

A logical; if true, use no color and use lower-case letters to indicate group membership.

leg.loc

Character; if "none" no legend will be drawn. Otherwise, any string acceptable to legend.

...

Other parameters to be passed to the plotting functions.

Value

A list, containing an object of class hclust and an object of class dendrogram. The side effect is a plot.

Author(s)

Bryan A. Hanson, DePauw University.

See Also

hclust for the underlying function. hcaScores for similar analysis of PCA scores from a Spectra object. Additional documentation at https://bryanhanson.github.io/ChemoSpec/

Examples

data(SrE.IR)
myt <- expression(bolditalic(Serenoa) ~ bolditalic(repens) ~ bold(IR ~ Spectra))
res <- hcaSpectra(SrE.IR, main = myt)

ChemoSpec

Exploratory Chemometrics for Spectroscopy

v5.3.11
GPL-3
Authors
Bryan A. Hanson [aut, cre] (<https://orcid.org/0000-0003-3536-8246>), Mike Bostock [cph, ctb] (author of the d3.js library used by plotSpectraJS, http://d3js.org), Matt Keinsley [ctb] (author of initial AOV-PCA code)
Initial release
2021-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.