Learn R Programming

PerMallows (version 1.8)

r.derangement: Generate a collection of derangements

Description

Given a number of permutations and the number of items in the permutations generate a sample of permutations with the specified length and no fixed point

Usage

r.derangement(n, perm.length)

Arguments

n
number of permutations in the sample
perm.length
number of items in the permutations

Value

  • A sample of permutations with the specified length and number of cycles

Examples

Run this code
r.perms.cycles(1, 4, 2)

Run the code above in your browser using DataLab