ppv: Permutations Pseudo-Vector Constructor

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

View source: R/trotter.R

Description

The PPV class defines a pseudo-vector containing all the k-permutations of the objects stored in items. The function ppv is a constructor for this class.

Usage

1
ppv(k, items)

Arguments

k

the number of objects taken at a time.

items

a vector of objects to be permuted.

Details

The arrangement of permutations is similar, but in many cases not identical, to that obtained from the Steinhaus-Johnson-Trotter algorithm (see references).

Value

an instance of PPV.

Author(s)

Richard Ambler

References

Steinhaus-Johnson-Trotter algorithm. (2014, April 29). In Wikipedia, The Free Encyclopedia. Retrieved 13:24, September 5, 2014

See Also

Combinations Pseudo-Vector cpv

Amalgams Pseudo-Vector apv

Selections Pseudo-Vector spv

Subsets Pseudo-Vector sspv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# create a pseudo-vector of 5-permutations from the first 10 letters
p <- ppv(5, letters[1:10])
# generate a description
print(p)
# compatable with length
length(p)
# inspect a few of the permutations "stored" in p
p[1]
p[1000]
p[30240]

trotter documentation built on May 2, 2019, 1:27 p.m.

Related to ppv in trotter...