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

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)

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.

Value

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

See Also

Examples

perm(3, 3, 2:4)

mixtools

Tools for Analyzing Finite Mixture Models

v1.2.0
GPL (>= 2)
Authors
Derek Young [aut, cre] (<https://orcid.org/0000-0002-3048-3803>), Tatiana Benaglia [aut], Didier Chauveau [aut], David Hunter [aut], Ryan Elmore [ctb], Thomas Hettmansperger [ctb], Hoben Thomas [ctb], Fengjuan Xuan [ctb]
Initial release
2020-02-05

We don't support your browser anymore

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