sample.all | R Documentation |
sample.all
returns a matrix of all sampling variations/permutations from a set of integers
sample.all(n, size = n, replace = FALSE, prob = NULL)
n |
Number of integers to sample from |
size |
Length of the sample vectors |
replace |
Logical value; if |
prob |
Probability vector giving the sampling probability for each element (must be a probability vector with length |
This function computes all sample vectors of size size
composed of the elements 1, ..., n
, either with or without replacement
of elements. If size = n
and replace = TRUE
then the list of all sample vectors corresponds to a list of all permutations of
the integers 1, ..., n
.
A matrix of all permutations of the elements 1, ..., n
(rows of the matrix give the permutations)
sample.all(n = 4, replace = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.