R/sampleDist.Spectra2D.R

Defines functions sampleDist.Spectra2D

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

  M1 <- ChemoSpec2D::.unstack(spectra)
  M <- rowDist(M1, method)
  M <- as.matrix(M)
  dimnames(M) <- list(spectra$names, spectra$names)

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

  M
}

Try the ChemoSpecUtils package in your browser

Any scripts or data that you put into this service are public.

ChemoSpecUtils documentation built on May 29, 2024, 3:12 a.m.