Learn R Programming

crochet (version 2.3.0)

ktoij: Convert One-Dimensional Index k to Two-Dimensional Indices i and j

Description

ktoij is a helper function that converts a one-dimensional index k to two-dimensional indices i and j. This can be useful if, for example, two-dimensional indexing is easier to implement than one-dimensional indexing.

Usage

ktoij(x, k)

Arguments

x

A matrix-like object.

k

A one-dimensional index.

Value

A list containing indices i and j.

Details

It is assumed that all indices are one-based.