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

permut

Generate all permutations of m elements of a vector


Description

Generate all permutations of x taken m at a time. If argument FUN is not NULL, applies a function given by the argument to each permutation.

Usage

permut(x, m=length(x), FUN=NULL,...)

Arguments

x

vector source for permutations.

m

number of elements to choose. Default is m=length(x).

FUN

function to be applied to each permutation; default NULL means the identity, i.e., to return the permutation.

...

optionally, further arguments to FUN.

Details

Based on function permutations from package gtools. This function is required for the computation of the exact p-value of some randomness tests.

Value

A matrix with one permutation, or the value returned by FUN, in each line.


randtests

Testing randomness in R

v1.0
GPL (>= 2)
Authors
Frederico Caeiro and Ayana Mateus
Initial release
2014-11-16

We don't support your browser anymore

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