as_diag: Construct diagonal matrix from vector

View source: R/lin_alg.R

as_diagR 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
}


caracas documentation built on June 22, 2024, 10:59 a.m.