R/sampleDist.Spectra.R

Defines functions sampleDist.Spectra

#'
#' sampleDist.Spectra
#'
#' @author `r .writeDoc_Authors("BH")`
#' @export
#' @noRd
#'
sampleDist.Spectra <- function(spectra, method = "pearson", plot = TRUE, ...) {
  .chkArgs(mode = 11L)
  chkSpectra(spectra)

  M <- rowDist(spectra$data, method)
  M <- as.matrix(M)
  dimnames(M) <- list(spectra$names, spectra$names)

  if (plot) .distPlot(spectra, M, method, ...)

  M
}
bryanhanson/ChemoSpecUtils documentation built on Feb. 6, 2024, 6:40 a.m.