as.Matrix: Convert a Ryacas Symbolic Matrix to a Character Matrix

Description Usage Arguments Value Author(s) See Also Examples

Description

It converts a Ryacas Symbolic Matrix to a Character Matrix in R.

Usage

1
2
## S3 method for class 'yac_symbol'
as.matrix(x, ...)

Arguments

x

A symbolic matrix of class "yac_symbol".

...

not used

Value

A character matrix.

Author(s)

Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>

See Also

sym

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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" 

symSEM documentation built on July 16, 2020, 9:06 a.m.