print: Print methods for permutation objects

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Print methods for permutation objects with matrix-like printing for words and bracket notation for cycle objects.

Usage

1
2
3
4
5
## S3 method for class 'cycle'
print(x, ...)
## S3 method for class 'word'
print(x, h = getOption("print_word_as_cycle"), ...)
as.character_cyclist(y,comma=TRUE)

Arguments

x

Object of class permutation with words dispatched to print.word() and cycles dispatched to print.cycle()

h

Boolean, with default TRUE meaning to coerce words to cycle form before printing. See details

...

Further arguments (currently ignored)

y,comma

In as.character.cyclist(), argument y is a list of cycles (a cyclist); and comma is Boolean, specifying whether to include a comma in the output

Details

Printing of word objects is controlled by options("print_word_as_cycle"). The default behaviour is to coerce a word to cycle form and print that, with a notice that the object itself was coerced from word.

If options("print_word_as_cycle") is FALSE, then objects of class word are printed as a matrix with rows being the permutations and fixed points indicated with a dot.

Value

Returns its argument invisibly, after printing it.

Author(s)

Robin K. S. Hankin

See Also

nicify_cyclist

Examples

1
2
3
x <- rperm(4,9)
as.word(x)
as.cycle(x)


Search within the permutations package
Search all R packages, documentation and source code

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

Please suggest features or report bugs with the GitHub issue tracker.

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