Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

symmIndex2vectorIndex

Array: make vector positions from symmetric array index


Description

make vector positions from (non-symmetric) array index respecting dim and fixdiag

Usage

symmIndex2vectorIndex(x, dim, fixdiag = NULL)

Arguments

x

a matrix[,1:2] with matrix subscripts

dim

the dimensions of the symmetric matrix

fixdiag

NULL assumes free diagonal, any value assumes fixed diagonal

Details

With fixdiag = NULL

Value

a vector of indices in seq_len(prod(dim(x)))

Author(s)

Jens Oehlschlägel

See Also

Examples

symmIndex2vectorIndex(rbind(
   c(1,1)
  ,c(1,10)
  ,c(10,1)
  ,c(10,10)
  ), dim=c(10,10))
  symmIndex2vectorIndex(rbind(
   c(1,1)
  ,c(1,10)
  ,c(10,1)
  ,c(10,10)
  ), dim=c(10,10), fixdiag=1)

ff

Memory-Efficient Storage of Large Data on Disk and Fast Access Functions

v4.0.4
GPL-2 | GPL-3 | file LICENSE
Authors
Daniel Adler [aut], Christian Gläser [aut], Oleg Nenadic [aut], Jens Oehlschlägel [aut, cre], Martijn Schuemie [aut], Walter Zucchini [aut]
Initial release
2020-10-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.