powered by
Replace diagonal
# S3 method for caracas_symbol diag(x) <- value
A caracas_symbol.
caracas_symbol
Replacement value
# NOT RUN { if (have_sympy()) { A <- matrix(c("a", 0, 0, 0, "a", "a", "a", 0, 0), 3, 3) B <- as_symbol(A) B diag(B) diag(B) <- "b" B diag(B) } # }
Run the code above in your browser using DataLab