Calculates the inverse of a permutation in either word or cycle form
1 2 3 4 5 6 7
Object of class
The package provides methods to invert objects of class
(the R idiom is
W[W] <- seq_along(W)) and also objects of class
cycle (the idiom is
The user should use
inverse() directly, which dispatches to
inverse.cycle() as appropriate.
Sometimes, using idiom such as
id/x gives neater
code, although these may require coercion between word form and cycle
inverse() returns an object of the same class as its argument.
Robin K. S. Hankin
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.