\HeaderA{cals-methods}{Similarity by user defined function}{cals.Rdash.methods}
\aliasA{cals,Massvector,Massvector-method}{cals-methods}{cals,Massvector,Massvector.Rdash.method}
\aliasA{cals,Massvectorlist,Massvector-method}{cals-methods}{cals,Massvectorlist,Massvector.Rdash.method}
\aliasA{cals,Massvectorlist,NULL-method}{cals-methods}{cals,Massvectorlist,NULL.Rdash.method}
\aliasA{cals,numeric,numeric-method}{cals-methods}{cals,numeric,numeric.Rdash.method}
\keyword{methods}{cals-methods}
\begin{Description}\relax
Compute similarity between two Massvectors using a similarity function
passed to argument msim
\end{Description}
\begin{Arguments}
\begin{ldescription}
\item[\code{obx}] see below in \bold{Methods} section
\item[\code{oby}] see above in \bold{Methods} section
\item[\code{error}] measurement error
\item[\code{ppm}] if \code{TRUE} then error in parts per million, in arbitrary units otherwise
\item[\code{msim}] similarity function
\item[\code{p}] argument to similarity function
\item[\code{uniq}] if \code{TRUE} compute optimal aligmnent
\end{ldescription}
\end{Arguments}
\begin{Value}
Scalar, Vector or object of class \code{dist}
\end{Value}
\begin{Section}{Methods}
\describe{
\item[obx = "numeric", oby = "numeric"] given two vectors computes
alignement and similarity using function passed to arguement mdist
\item[obx = "Massvector", oby = "Massvector"] same for \code{Massvectors}
\item[obx = "Massvectorlist", oby = "Massvector"] compute similarities
between \code{Massvector} and \code{Massvectorlist}
\item[obx = "Massvectorlist", oby = "NULL"] computes object of class
\code{dist} casting the similarities into distances
}
\end{Section}
\begin{Author}\relax
Witold E. Wolski \email{witek96@users.sourceforge.net}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{calssim}{calssim}},\code{\LinkA{calsrange}{calsrange}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(pldata)
pl1 <- pldata[[1]]
pl2 <- pldata[[2]]
cals(pl1,pl2,error=400,ppm=TRUE,msim=calssim,p=3)
cals(pl1,pl2,error=400,ppm=TRUE,msim=calsrange)
tmp <- cals(pldata,NULL,error=400,ppm=TRUE,msim=calssim,p=3)
plot(hclust(tmp,method="average"))
\end{ExampleCode}
\end{Examples}

