swh:1:snp:1d6f9c912933e835b749aef1f8077112982fe84e
Raw File
Tip revision: 1305bf51cc38adca02d0c8a834c61a4c7e038309 authored by Hans W. Borchers on 08 February 2015, 00:00:00 UTC
version 1.8.3
Tip revision: 1305bf5
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