Get matrix as character matrix

as_character_matrix(x)

Arguments

x

caracas symbol

Examples

if (has_sympy()) {
  s  <- as_sym("[[r1, r2, r3], [u1, u2, u3]]")
  s2 <- apply(as_character_matrix(s), 2, function(x) (paste("1/(", x, ")")))
  as_sym(s2)
}
#> c: ⎡1   1   1 ⎤
#>    ⎢──  ──  ──⎥
#>    ⎢r₁  r₂  r₃⎥
#>    ⎢          ⎥
#>    ⎢1   1   1 ⎥
#>    ⎢──  ──  ──⎥
#>    ⎣u₁  u₂  u₃⎦