% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preproc_excise.R
\name{excise}
\alias{excise}
\title{Excise Chemical Shift Regions from 1D NMR Spectra}
\usage{
excise(x, ppm = NULL, regions = NULL)
}
\arguments{
\item{x}{Numeric matrix or vector. Spectra in rows and variables in columns.}

\item{ppm}{Numeric vector of chemical shift positions (ppm).
If omitted, \code{ppm} is inferred from \code{colnames(X)}.}

\item{regions}{Named list of numeric vectors (length 2), specifying ppm
regions to remove. Each element must define lower and upper bounds.}
}
\value{
Numeric matrix with specified chemical shift regions removed.
}
\description{
Removes specified chemical shift regions from 1D \eqn{^1}H NMR spectra.
By default, commonly excluded metabolomics regions are removed
(upfield/downfield noise, water, urea).
}
\details{
Default regions removed (ppm):
\itemize{
\item Upfield noise: \code{[min(ppm), 0.25]}
\item Residual water: \code{[4.5, 5.2]}
\item Urea region: \code{[5.5, 6.0]}
\item Downfield noise: \code{[9.7, max(ppm)]}
}

Removed regions are recorded in \code{attr(X, "m8_prep")} if present.
Updated ppm values are stored in column names and in
\code{attr(X, "m8_axis")$ppm}.
}
\examples{
set.seed(1)
ppm <- seq(0, 10, length.out = 1000)
X <- matrix(rnorm(100 * length(ppm)), nrow = 100)

Xe <- excise(X, ppm)

dim(Xe)
names(attributes(Xe))
}
