util.sub2ind: Convert subscripts to linear indices in column major order

View source: R/utils.R

util.sub2indR Documentation

Convert subscripts to linear indices in column major order

Description

This function is somewhat the equivalent of the Matlab sub2ind.

Usage

ind <- sub2ind(i,j,n), then A[i,j] == A[ind] if dim(A)[1] == n

Arguments

i

row index

j

column index

n

number of rows

Value

the linear index.


UCD-GW-Nitrate/gwtools documentation built on April 5, 2025, 5:01 p.m.