R/chkSpectra.R

Defines functions chkSpectra

Documented in chkSpectra

#'
#' Verify the Integrity of a Spectra or Spectra2D Object
#'
#' Utility function to verify that the structure of a \code{\link[ChemoSpec]{Spectra}}
#' or \code{\link[ChemoSpec2D]{Spectra2D}} object is internally consistent.
#' This function should be used after manual editing of these objects.
#' However, in most cases rather than
#' directly editing these objects, one should modify them via:
#' \itemize{
#'   \item {\code{\link{removeFreq}}}
#'   \item {\code{\link{removeSample}}}
#'   \item {\code{\link{removeGroup}}}
#' }
#'
#' @param spectra `r .writeDoc_Spectra3()`
#'
#' @param confirm Logical indicating whether or not to write the results to the
#' console, as would be desirable for interactive use.
#'
#' @return None. When used at the console, and the object is OK, no message is
#' written unless \code{confirm = TRUE}.  At the console, if there is a
#' problem, messages are issued regardless of the value of \code{confirm}.
#'
#' @author `r .writeDoc_Authors("BH")`
#'
#' @keywords classes utilities
#'
#' @export chkSpectra
#' @importFrom utils str
#'
#' @examples
#' if (checkForPackageWithVersion("ChemoSpec", 6.0)) {
#'   library("ChemoSpec")
#'   data(SrE.IR)
#'   chkSpectra(SrE.IR)
#' }
#'
#' if (checkForPackageWithVersion("ChemoSpec2D", 0.5)) {
#'   library("ChemoSpec2D")
#'   data(MUD1)
#'   chkSpectra(MUD1)
#' }
chkSpectra <- function(spectra, confirm = FALSE) {
  UseMethod("chkSpectra")
}

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.