tri | R Documentation |
Construct a matrix with ones at and below the given diagonal and zeros elsewhere.
tri(nrow, ncol = nrow, k = 0, diag = TRUE)
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
|
tri(5, 5)
tri(5, 5, 2)
tri(5, 5, -1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.