Functions to create permutation objects. `permutation`

is a
virtual class.

1 2 3 4 5 6 7 8 9 10 11 12 | ```
word(M)
is.permutation(x)
cycle(x)
is.word(x)
is.cycle(x)
as.word(x,n=NULL)
as.cycle(x)
cycle2word(x,n=NULL)
char2cycle(char)
cyc_len(n)
## S3 method for class 'word'
as.matrix(x,...)
``` |

`M` |
In function |

`x` |
See details |

`n` |
In functions |

`char` |
In function |

`...` |
Further arguments passed to |

Functions `word()`

and `cycle()`

are rather formal functions
which make no attempt to coerce their arguments into sensible forms.
The user should use `as.word()`

and `as.cycle()`

, which are
much more user-friendly.

Functions `word()`

and `cycle()`

are the only functions in the
package which assign class `word`

or `cycle`

to an
object.

A *word* is a matrix whose rows correspond to permutations in word
format.

A cycle is a list whose elements correspond to permutations in
cycle form. A `cycle`

object comprises elements which are
informally dubbed ‘cyclists’. A cyclist is a list of integer
vectors corresponding to the cycles of the permutation.

Function `cycle2word()`

converts cycle objects to word objects.

Function `cyc_len()`

is a convenience wrapper for
`as.cycle(seq_len(n))`

.

It is a very common error (at least, it is for me) to use `cycle()`

when you meant `as.cycle()`

.

Returns a `cycle`

object or a `word object`

Robin K. S. Hankin

`cyclist`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
word(matrix(1:8,7,8))
cycle(list(list(c(1,8,2),c(3,6)),list(1:2, 4:8)))
char2cycle(c("(1,4)(6,7)","(3,4,2)(8,19)", "(56)","(12345)(78)","(78)"))
jj <- c(4,2,3,1)
as.word(jj)
as.cycle(jj)
as.cycle(1:2)*as.cycle(1:8) == as.cycle(1:8)*as.cycle(1:2) # FALSE!
x <- rperm(10,7)
y <- rperm(10,7)
as.cycle(commutator(x,y))
cycle(sapply(seq_len(9),function(n){list(list(seq_len(n)))}))
cycle(sapply(seq_len(18),cyc_len))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.