Extract or replace parts of an object
# S3 method for caracas_symbol
[(x, i, j, ...) <- value
A caracas_symbol
.
row indices specifying elements to extract or replace
column indices specifying elements to extract or replace
Not used
Replacement value
if (has_sympy()) {
A <- matrix(c("a", 0, 0, 0, "a", "a", "a", 0, 0), 3, 3)
B <- as_sym(A)
B[, 2] <- "x"
B[, 3] <- vector_sym(3)
B
}
#> c: ⎡a x v₁⎤
#> ⎢ ⎥
#> ⎢0 x v₂⎥
#> ⎢ ⎥
#> ⎣0 x v₃⎦