\HeaderA{bslnoff}{Baseline Substraction}{bslnoff}
\keyword{nonparametric}{bslnoff}
\begin{Description}\relax
This function estimates the baseline and then removes baseline from the raw spectrum.
\end{Description}
\begin{Usage}
\begin{verbatim}
bslnoff(f, breaks = 200, qntl = 0, method = c("loess", "approx"), bw = 0.005, plot = FALSE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{f}] a matrix with M/Z values in the first column and intensities in the second column 
\item[\code{breaks}] number of breaks set to M/Z values for finding the local minima or points below a centain quantile of intensities; breaks -1 equally spaced intervals on the log M/Z scale. 
\item[\code{qntl}] if 0, find local minima; if >0 find intensities < qntl*100th quantile locally.
\item[\code{method}] "loess" or "approx" (linear interpolation).
\item[\code{bw}] the bandwidth to be passed to loess.
\item[\code{plot}] TRUE or FALSE, if true, it will plot the raw spectrum, theestimated baseline and the baseline substracted spectrum.
\item[\code{...}] Further parameters that get passed on to plot.
\end{ldescription}
\end{Arguments}
\begin{Value}
a matrix of two columns: the first column being the M/Z values same as 
the input, and the second column being the baseline substracted spectra.
\end{Value}
\begin{Author}\relax
Xiaochun Li
\end{Author}
\begin{Examples}
\begin{ExampleCode}
fdat <- system.file("Test", package = "PROcess")
fs <- list.files(fdat, pattern="\.*csv\.*", full.names=TRUE)
f1 <- read.files(fs[1])
fcut <- f1[f1[,1]>0,]
bseoff <-bslnoff(fcut,method="loess",plot=TRUE, bw=0.1)
title(basename(fs[1]))
\end{ExampleCode}
\end{Examples}

