Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rperm

Random permutations


Description

Create a word object of random permutations

Usage

rperm(n,r,moved=NA)

Arguments

n

Number of permutations to create

r

Size of permutations

moved

Integer specifying how many elements can move (that is, how many elements do not map to themselves), with default NA meaning to choose a permutation at random. This is useful if you want a permutation that has a compact cycle representation

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).

Author(s)

Robin K. S. Hankin

See Also

Examples

rperm(30,9)
as.cycle(rperm(30,9))


rperm(10,9,2)

permutations

The Symmetric Group: Permutations of a Finite Set

v1.0-9
GPL-2
Authors
Robin K. S. Hankin [aut, cre] (<https://orcid.org/0000-0001-5982-0415>), Paul Egeler [ctb] (<https://orcid.org/0000-0001-6948-9498>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.