Learn R Programming

mixtools (version 2.0.0)

perm: Permutation Function

Description

Enumerates the possible permutations of a specified size from the elements of a vector having the same size.

Usage

perm(n, r, v = 1:n)

Value

perm returns a matrix where each row contains one of the permutations of length r.

Arguments

n

Size of the source vector.

r

Size of the target vector.

v

Source vector. Must be a vector of length n.

Details

This function is called by segregmixEM and the associated internal functions. This is also a simplified version of the function permutations found in the package gtools.

See Also

segregmixEM

Examples

Run this code
perm(3, 3, 2:4)

Run the code above in your browser using DataLab