Description Usage Arguments Author(s) Examples
Fills a matrix with a vector that represents the triangular elements.
The function can produce a strictly triangular matrix,
that is, the diagonal elements are set to zero
or a triangular matrix with diagonal values
supplied by the argument x
.
Note that the matrix is filled by column.
1 |
x |
A vector. |
lower |
Logical.
If |
diag |
Logical.
If |
Ivan Jacob Agaloos Pesigan
1 2 3 4 5 6 7 8 9 10 | # Stricly lower triangular matrix
vech2tri(1:10, lower = TRUE, diag = FALSE)
# Lower triangular matrix with diagonal and off-diagonal values
# supplied by the argument x
vech2tri(1:10, lower = TRUE, diag = TRUE)
# Stricly upper triangular matrix
vech2tri(1:10, lower = FALSE, diag = FALSE)
# Upper triangular matrix with diagonal and off-diagonal values
# supplied by the argument x
vech2tri(1:10, lower = FALSE, diag = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.