## Create a character matrix
A1 <- matrix(c(1, 2, 3, "a", "b", "c"), ncol=2, nrow=3)
# [,1] [,2]
# [1,] "1" "a"
# [2,] "2" "b"
# [3,] "3" "c"
## Convert it to an Ryacas matrix for symbolic calculations
A2 <- sym(A1)
# {{1, a},
# {2, b},
# {3, c}}
## Convert it back to a character matrix
as.matrix(A2)
# [,1] [,2]
# [1,] "1" "a"
# [2,] "2" "b"
# [3,] "3" "c"
Run the code above in your browser using DataLab