\name{distance}
\alias{distance}
\title{Distance Matrix Computation}
\description{Computes Euclidean or Manhattan distances for all pairs of points between two sets of points.}
\usage{
distance(m1, m2, type = "euclidean")
}
\arguments{
  \item{m1}{a matrix or data frame containing origin point coordinates in the first two columns.}
  \item{m2}{a matrix or data frame containing destination point coordinates in the first two columns.}
  \item{type}{the type of distance to be computed. Two types are currently supported: \code{"euclidean"} and \code{"manhattan"}.}
}
\details{When m1 and m2 are identical, the function is equivalent to the \code{\link{dist}} function of base R.}

\value{A distance matrix in which rows refer to origins and columns refer to destinations.}

\author{Stamatis Kalogirou <stamatis.science@gmail.com>}


\seealso{
\code{\link{dist}} in stats.}

\examples{
m1 <- cbind(1:10, 1:10)
m2 <- cbind(c(20, 40, 60, 80), c(25, 45, 65, 85))
d <- distance(m1, m2)
}
\keyword{distance matrix}
\keyword{accessibility}
