Revision d50cda4811eb3cdb8d2ce9e01ddb5e07d4a8c24f authored by HwB on 11 September 2013, 00:00:00 UTC, committed by Gabor Csardi on 11 September 2013, 00:00:00 UTC
1 parent 10ae2bb
Raw File
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