get_triangle.Rd
A simple function returning upper or lower matrix triangle. Remaining triangle is replaced with NAs.
get_triangle(cormat, part = "upper")
cormat | Usually correlation matrix |
---|---|
part | Single string vector decide whether to return |
Object of dimensions dim(cormat)
with NA
values being
present in lower or upper triangle.
The functions as a wrapper on lower.tri
and
upper.tri
functions.
#> [,1] [,2] [,3] [,4] [,5] #> [1,] 1 6 11 16 1 #> [2,] NA 7 12 17 2 #> [3,] NA NA 13 18 3 #> [4,] NA NA NA 19 4 #> [5,] NA NA NA NA 5