https://github.com/cran/pracma
Raw File
Tip revision: 71455748623ef69836470c75c5f9384f6e872d45 authored by HwB on 28 June 2011, 00:00:00 UTC
version 0.6-3
Tip revision: 7145574
perms.Rd
\name{perms}
\alias{perms}
\title{
Generate Permutations
}
\description{
Generates all permutations of a vector \code{a}.
}
\usage{
perms(a)
}
\arguments{
  \item{a}{numeric vector of some length \code{n}}
}
\details{
  If \code{a} is a vector of length \code{n}, generate all permutations
  of the elements in \code{a} as a matrix of size \code{n! x n} where
  each row represents one permutation.

  A matrix will be expanded as vector.
}
\value{
  matrix of permutations of the elements of \code{a}
}
\note{
Not feasible for \code{length(a) > 10}.
}
\seealso{
\code{\link{randperm}}
}
\examples{
perms(6)
perms(1:6)
perms(c(1, exp(1), pi))
}
\keyword{ arith }
back to top