shuffle
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
Create a shuffled version of a set.
- Usage
shuffle(x {, n {, once { seed}}})
- x
- the set to be shuffled; must be a vector or matrix
- n
- the number of row exchanges applied top x;
0 < n
(default=nrow(x)/2)
- oncem
- the size of the random sample;
0 < m < n
- Result
- A vector with length m, containing the indices of the selected elements of the set.
- It is assumed that the set is indexed from 0 to n-1 (i.e. the number of elements). The result vector can be applied as an index list on the set to extract the corresponding elements.