powered by
Extract the lower triangular part of a matrix.
tril(x, k = 0, diag = TRUE)
A matrix.
The sub-diagonal at and below which the matrix is filled. k = 0 is the main diagonal, while k < 0 is below it, and k > 0 is above. The default is 0.
k = 0
k
Logical indicating whether to include the diagonal. Default is TRUE.
TRUE
tril(ones(5, 5)) tril(ones(5, 5), diag = TRUE)
Run the code above in your browser using DataLab