Description Usage Arguments Details Author(s) References See Also Examples
View source: R/linearAlgebra-diag_of_vech.R
Diagonals of a matrix from its half-vectorization.
1 | diag_of_vech(x, loc = FALSE)
|
x |
Vector.
Half-vectorization of a |
loc |
Logical.
If |
Generates a vector of length k of diagonal elements or location in the input vector of an k \times k matrix.
Ivan Jacob Agaloos Pesigan
Other Vectorization Functions:
vec_mean()
,
vechnames()
,
vechsnames()
,
vechs()
,
vech()
,
vec()
1 2 3 4 5 6 7 8 9 10 11 12 | A <- matrix(
data = c(
1.0, 0.5, 0.4,
0.5, 1.0, 0.6,
0.4, 0.6, 1.0
),
ncol = 3
)
vechA <- c(1.0, 0.5, 0.4, 1.0, 0.6, 1.0)
diag_of_vech(vechA, loc = FALSE)
diag_of_vech(vechA, loc = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.