tri {ramify} | R Documentation |
Lower/Upper Triangular Matrix
Description
Construct a matrix with ones at and below the given diagonal and zeros elsewhere.
Usage
tri(nrow, ncol = nrow, k = 0, diag = TRUE)
Arguments
nrow |
The desired number of rows. |
ncol |
The desired number of columns. |
k |
The sub-diagonal at and below which the matrix is filled.
|
diag |
Logical indicating whether to include the diagonal. Default is
|
Examples
tri(5, 5)
tri(5, 5, 2)
tri(5, 5, -1)
[Package ramify version 0.3.3 Index]