indices: Returns quickly indices for a matrix of size N

Description Usage Arguments Value

View source: R/indices.R

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

1
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


MarianaLag/Mlag documentation built on Feb. 13, 2020, 12:30 a.m.