get2dFrom1d {dissimilarities}R Documentation

1D-indexing to 2D-indexing

Description

Efficiently computes 2D-indexing from 1D-indexing

Usage

get2dFrom1d(idx1d, N)

Arguments

idx1d

An integer vector of 1D indexes

N

The number of observations in the original data matrix

Details

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."

Value

An integer matrix storing the corresponding 2D indexes.

Author(s)

Minh Long Nguyen edelweiss611428@gmail.com

Examples


get2dFrom1d(1:10, 5)


[Package dissimilarities version 0.3.0 Index]