https://github.com/cran/pracma
Raw File
Tip revision: 708a2ad382a163d1eef5af0665e3ae2aad200ced authored by HwB on 21 March 2013, 00:00:00 UTC
version 1.4.5
Tip revision: 708a2ad
sortrows.Rd
\name{sortrows}
\alias{sortrows}
\title{Sort Rows of a Matrix (Matlab Style)}
\description{
  Sort rows of a matrix according to values in a column.
}
\usage{
sortrows(A, k = 1)
}
\arguments{
  \item{A}{numeric matrix.}
  \item{k}{number of column to sort the matrix accordingly.}
}
\details{
  \code{sortrows(A, k)} sorts the rows of the matrix \code{A} such that
  column \code{k} is increasingly sorted.
}
\value{
  Returns the sorted matrix.
}
\seealso{ 
  \code{\link{sort}}
}   
\examples{
A <- magic(5)
sortrows(A)
sortrows(A, k = 2)
}
\keyword{array}
back to top