R/hcaScores.Spectra2D.R

Defines functions hcaScores.Spectra2D

#'
#' hcaScores.Spectra2D
#'
#' @author `r .writeDoc_Authors("BH")`
#' @export
#' @noRd
#' @importFrom stats hclust
#'
hcaScores.Spectra2D <- function(spectra, so, scores = c(1:5),
                                c.method = "complete", d.method = "euclidean",
                                use.sym = FALSE, leg.loc = "topright", ...) {
  .chkArgs(mode = 22L)
  chkSpectra(spectra)

  sub.title <- paste("clustering method: ", c.method, "      distance method: ", d.method, sep = "")

  distance <- rowDist(as.data.frame(so$C[, scores], row.names = spectra$names), method = d.method)
  hclst <- hclust(distance, method = c.method)

  d <- .plotHCA(
    spectra = spectra, hclst = hclst, sub.title = sub.title,
    use.sym = FALSE, leg.loc = leg.loc, ...
  )
  L <- list(hclst = hclst, dend = d)
  return(L)
}

Try the ChemoSpecUtils package in your browser

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

ChemoSpecUtils documentation built on May 31, 2023, 5:56 p.m.