triu {ramify} | R Documentation |
Extract the upper triangular part of a matrix.
triu(x, k = 0, diag = TRUE)
x |
A matrix. |
k |
Diagonal below which to zero elements. |
diag |
Logical indicating whether to include the diagonal. Default is
|
triu(ones(5, 5))
triu(ones(5, 5), diag = FALSE)