shuffle

From STX Wiki
< Programmer Guide‎ | Command Reference‎ | EVAL
Revision as of 15:56, 8 April 2011 by Toni (talk | contribs) (Created page with '{{DISPLAYTITLE:{{SUBPAGENAME}}}} Create a ''shuffled'' version of a set. ;Usage: '''<code>shuffle(''x'' {, ''n'' {, ''once'' { ''seed''}}})</code>''' :;''x'': the set to be shuf…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.
See also
rand, grand, shuffle

<function list>

Navigation menu

Personal tools