diag<-.caracas_symbol {caracas}R Documentation

Replace diagonal

Description

Replace diagonal

Usage

## S3 replacement method for class 'caracas_symbol'
diag(x) <- value

Arguments

x

A caracas_symbol.

value

Replacement value

Examples

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


[Package caracas version 1.1.0 Index]