indices: Returns quickly indices for a matrix of size N

View source: R/indices.R

indicesR Documentation

Returns quickly indices for a matrix of size N

Description

This is used in conjunction with apply to get around doing nested loops in R. This function is slightly faster than expand.grid. This function was lifted from a discussion on stackoverflow.

Usage

indices(seq, only.unique = TRUE)

Arguments

seq

The first Sequence.

only.unique

Makes sure to return only i,j and not both [i,j] and [j,i] values

Value

A matrix of indicies


dyerlab/gstudio documentation built on Jan. 17, 2025, 11:17 a.m.