Learn R Programming

caracas (version 2.0.0)

diag_: Symbolic diagonal matrix

Description

Symbolic diagonal matrix

Usage

diag_(x, n = 1L, declare_symbols = TRUE, ...)

Arguments

x

Character vector with diagonal

n

Number of times x should be repeated

declare_symbols

Passed on to as_sym() when constructing symbolic matrix

...

Passed on to rep(x, n, ...)

Examples

Run this code
if (has_sympy()) {
  diag_(c(1,3,5))
  diag_(c("a", "b", "c"))
  diag_("a", 2)
  diag_(vector_sym(4))
}

Run the code above in your browser using DataLab