R/lin_alg.R
diag-set-.caracas_symbol.Rd
Replace diagonal
# S3 method for caracas_symbol diag(x) <- value
A caracas_symbol.
caracas_symbol
Replacement value
if (has_sympy()) { A <- matrix(c("a", 0, 0, 0, "a", "a", "a", 0, 0), 3, 3) B <- as_sym(A) B diag(B) diag(B) <- "b" B diag(B) } #> c: [b b b]