Group: | Matrix Manipulation |
Topic: | General Commands |
See also: | paf sort |
Function: | index | |
Description: | index generates a new matrix z from an old matrix x by resampling the rows of x depending on the index vector i. |
Usage: | y = index (x, ind) | |
Input: | ||
x | n x p matrix | |
ind | k dimensional vector | |
Output: | ||
y | k x p matrix |
x = #(0.1, 0.2, 0.3, 0.4) i = #(4, 3, 2, 2, 1) ( index(x, i) )'
Contents of _tmp [1,] 0.4 0.3 0.2 0.2 0.1