get_upper_triangle_index: Returns the index of element in upper triangle of squared 'n'...

View source: R/disambr_utils.r

get_upper_triangle_indexR Documentation

Returns the index of element in upper triangle of squared n by n matrix

Description

inspired from https://math.stackexchange.com/questions/2134011 but modified so index starts from 1 as the original answer was for index starting from 0

Usage

get_upper_triangle_index(i, j, n)

Arguments

i

row index

j

column index

n

the size of squared matrix

Value

An index as integer number. Index starts from 1


stasvlasov/disambr documentation built on Aug. 10, 2022, 12:03 p.m.