as_diag {caracas}R Documentation

Construct diagonal matrix from vector

Description

Construct diagonal matrix from vector

Usage

as_diag(x)

Arguments

x

Matrix with 1 row or 1 column that is the diagonal in a new diagonal matrix

Examples

if (has_sympy()) {
  d <- as_sym(c("a", "b", "c"))
  D <- as_diag(d)
  D
}


[Package caracas version 1.1.0 Index]