Rfast (version 1.7.3)

Permutation : Permutation

Description

Permute the given vector.

Usage

permutation(x, all) permutation_next(x, all_next=TRUE) permutation_prev(x, all_prev=TRUE)

Arguments

x
A numeric vector with data.
all
A logical value for returning all or one possible combinations.
all_next
A logical value for returning all the next or one possible combinations.
all_prev
A logical value for returning all the previous or one possible combinations.

Value

Returns a matrix with all possible combinations of the given vector.

Details

This function implements "Permutation" which means all the possible combinations.

See Also

combn,comb_n

Examples

Run this code
y <- rnorm(5)
b <- permutation(y)
b <- permutation_next(y)
b <- permutation_prev(y)

Run the code above in your browser using DataCamp Workspace