Last data update: 2014.03.03

R: upper
upperR Documentation

upper

Description

Returns the (d*(d-1)/2) x 2 matrix of the (i,j) indexes to the upper triangle of a d x d matrix. The result can then directly be used as an index, see example.

Usage

upper(d)

Arguments

d

dimension of the square matrix which we intend to index.

Value

Index values

Author(s)

Pierrick Bruneau

Examples

inds <- upper(5)
vals <- matrix(runif(25), nrow=5)
selvals <- vals[inds] # vector containing the values of the upper triangle

Results