as.index: as.index: equivalent of MATLAB's ind2sub

Description Usage Arguments Value

View source: R/matlab.R

Description

Given the row and column of elements in an m <c3><97> n matrix, compute the single index which can be used to access those elements of A (also works if r and c are vectors)

Usage

1
as.index(rows, rownum, colnum)

Arguments

rows

Total number of rows in the matrix. Scalar value.

rownum

row subscript. vector of any length.

colnum

column subscript. vector of any length.

Value

A numeric vector of linear indices


wjhopper/whoppeR documentation built on May 4, 2019, 7:33 a.m.