lower.to.upper.tri.inds.Rd
Compute index vectors for extracting or reordering of lower or upper triangular matrices that are stored as contiguous vectors.
lower.to.upper.tri.inds(n) upper.to.lower.tri.inds(n)
n | integer larger than 1. |
---|
integer vector containing a permutation of 1:N
where
\(N = n(n-1)/2\).
#> [,1] [,2] [,3] [,4] [,5] #> [1,] NA NA NA NA NA #> [2,] 1 NA NA NA NA #> [3,] 2 3 NA NA NA #> [4,] 4 5 6 NA NA #> [5,] 7 8 9 10 NA#> [,1] [,2] [,3] [,4] [,5] #> [1,] NA 1 2 3 4 #> [2,] NA NA 5 6 7 #> [3,] NA NA NA 8 9 #> [4,] NA NA NA NA 10 #> [5,] NA NA NA NA NA