rp: Generates a random permutation

Description Usage Arguments Value Examples

View source: R/group.R

Description

If x is an integer, then returns an element of the symmetric group on x elements. If x is a vector, then generates a permutation of the elements of x.

Usage

1
rp(x)

Arguments

x

An integer or a vector.

Value

A vector representing a permutation.

Examples

1
2
rp(5)
rp(c(1, 4, 6, 10, 2))

gwb/RGroupFormation documentation built on Sept. 13, 2020, 4:41 p.m.