Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

permNext

The next permutation


Description

Returns for a permutation the next permutation

Usage

permNext(prm)

Arguments

prm

the length of required permutation, or the permutation for which the next we will

Details

When it is a natural number, then the program take it as the length of the required permutation, and returns the first permutation of the given length. If it is a sequence of natural numbers then it read it as a permutation, and returns the lexicographic next permutation of the same sequence.

Value

The next permutation in lexicographic oder.

See Also

Examples

# expect 1 2 3 4
permNext(4)
permNext(c(1,2,3,4))
permNext(c(4,2,3,1))

polyMatrix

Infrastructure for Manipulation Polynomial Matrices

v0.3.1
MIT + file LICENSE
Authors
Tamas Prohle [aut], Peter Prohle [aut], Nikolai Ryzhkov [aut, cre], Ildiko Laszlo [aut] (<https://orcid.org/0000-0003-2324-8183>), Ulas Onat Alakent [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.