Learn R Programming

permutations (version 1.1-5)

id: The identity permutation

Description

The identity permutation leaves every element fixed

Usage

is.id(x)
is.id_single_cycle(x)
# S3 method for cycle
is.id(x)
# S3 method for list
is.id(x)
# S3 method for word
is.id(x)

Value

The variable id is a cycle as this is more convenient than a zero-by-one matrix.

Function is.id() returns a Boolean with TRUE if the corresponding element is the identity, and FALSE otherwise. It dispatches to either is.id.cycle() or is.id.word() as appropriate.

Function is.id.list() tests a cyclist for identityness.

Arguments

x

Object to be tested

Author

Robin K. S. Hankin

Details

The identity permutation is problematic because it potentially has zero size.

See Also

is.derangement,nullperm

Examples

Run this code
is.id(id)

as.word(id)  # weird

x <- rperm(10,4)
x[3] <- id
is.id(x*inverse(x))

Run the code above in your browser using DataLab