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

tidy

Utilities to neaten permutation objects


Description

Various utilities to neaten word objects by removing fixed elements

Usage

tidy(x)
trim(x)

Arguments

x

Object of class word, or in the case of tidy(), coerced to class word

Details

Function trim() takes a word and, starting from the right, strips off columns corresponding to fixed elements until it finds a non-fixed element. This makes no sense for cycle objects; if x is of class cycle, an error is returned.

Function tidy() is more aggressive. This firstly removes all fixed elements, then renames the non-fixed ones to match the new column numbers. The map is an isomorphism (sic) with respect to composition.

Value

Returns an object of class word

Note

Results in empty (that is, zero-column) words if a vector of identity permutations is given

Author(s)

Robin K. S. Hankin

See Also

Examples

tidy(as.cycle(5:3)+as.cycle(7:9))
as.cycle(tidy(c(as.cycle(1:2),as.cycle(6:7))))


nicify_cyclist(list(c(4,6), c(7), c(2,5,1), c(8,3)))

data(megaminx)
tidy(megaminx)  # has 120 columns, not 129
stopifnot(all(unique(sort(unlist(as.cycle(tidy(megaminx)),recursive=TRUE)))==1:120))

jj <- megaminx*megaminx[1]
stopifnot(identical(shape(jj),shape(tidy(jj))))  #tidy() does not change shape

permutations

The Symmetric Group: Permutations of a Finite Set

v1.0-9
GPL-2
Authors
Robin K. S. Hankin [aut, cre] (<https://orcid.org/0000-0001-5982-0415>), Paul Egeler [ctb] (<https://orcid.org/0000-0001-6948-9498>)
Initial release

We don't support your browser anymore

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