powered by
Efficiently computes 2D-indexing from 1D-indexing
get2dFrom1d(idx1d, N)
An integer matrix storing the corresponding 2D indexes.
An integer vector of 1D indexes
The number of observations in the original data matrix
Minh Long Nguyen edelweiss611428@gmail.com
Converts 1D indexing (as used in R's "dist" objects) into 2D indexing (row-column pairs) for a distance matrix of size \(N \times N\).
Currently, name-based indexing is not supported."
get2dFrom1d(1:10, 5)
Run the code above in your browser using DataLab