ppv {trotter} | R Documentation |
Permutations Pseudo-Vector Constructor
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
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
# 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]
[Package trotter version 0.6 Index]