Learn R Programming

mgwrsar (version 1.3.2)

reord_D: reord_D

Description

Reorders the elements of a distance matrix row by row according to a corresponding index matrix.

Usage

reord_D(M, idxG)

Value

A reordered numeric matrix with the same number of rows as `M` and columns equal to the maximum index in `idxG`.

Arguments

M

A numeric matrix to be reordered.

idxG

An integer matrix of the same number of rows as `M`, where each row contains column indices indicating the new ordering for that row.