Various vector-like utilities for permutation objects.

Share:

Description

Various vector-like utilities for permutation objects such as length, names(), etc

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'word'
length(x)
## S3 replacement method for class 'permutation'
length(x) <- value
## S3 method for class 'word'
names(x)
## S3 replacement method for class 'word'
names(x) <- value

Arguments

x

permutation object

value

In function names<-.word(), the new names

Details

These functions have methods only for word objects; cycle objects use the methods for lists. It is easy to confuse the length of a permutation with its size.

It is not possible to set the length of a permutation; this is more trouble than it is worth.

Author(s)

Robin K. S. Hankin

See Also

size

Examples

1
2
3
4
names(megaminx) <- NULL   #makes it print more nicely.

x <- rperm(9,5)
names(x) <- letters[1:9]