rperm {permutations} | R Documentation |
Random permutations
Description
Function rperm()
creates a word object of random permutations.
Function rcyc()
creates random permutations comprising a single
(group-theoretic) cycle of a specified length (r1cyc()
is a
low-level helper function).
Usage
rperm(n=10,r=7,moved=NA)
rcyc(n,len,r=len)
r1cyc(len,r=len)
Arguments
n |
Number of permutations to create |
r |
Size of permutations |
len |
Length of cycles in |
moved |
In function |
Value
Returns an object of class word
Note
Argument moved
specifies a maximum number of elements
that do not map to themselves; the actual number of non-fixed elements
might be lower (as some elements might map to themselves). You can
control the number of non-fixed elements precisely with argument
len
of function rcyc()
, although this will give only
permutations with a single (group-theoretic) cycle.
Author(s)
Robin K. S. Hankin
See Also
Examples
rperm()
as.cycle(rperm(30,9))
rperm(10,9,2)
rcyc(20,5)
rcyc(20,5,9)