Exe: Execute Yacas Expression using Ryacas

Description Usage Arguments Author(s) References Examples

View source: R/Exe.R

Description

Executes Yacas expressions using Ryacas with different output options.

Usage

1
Exe(x, R = FALSE, format = "ysym", simplify = FALSE)

Arguments

x

Character string. Yacas expression.

R

Logical. If R = TRUE, returns symbolic result as an R expression. If R = FALSE, returns symbolic result as "ysym", "str", or "tex" depending of format.

format

Character string. Only used when R = FALSE. If format = "ysym", returns symbolic result as yac_symbol. If format = "str", returns symbolic result as a characetr string. If format = "tex", returns symbolic result as LaTeX math.

simplify

Logical. Simplify symbolic results.

Author(s)

Ivan Jacob Agaloos Pesigan

References

YACAS (Yet Another Computer Algebra System) - http://www.yacas.org/

Ryacas - http://r-cas.github.io/ryacas/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
A <- Ryacas::ysym(
  matrix(c("a", "c", "b", "d"), ncol = 2)
)
x <- paste0("Determinant(", A, ")")
Exe(x, R = FALSE, format = "ysym")
Exe(x, R = FALSE, format = "str")
Exe(x, R = FALSE, format = "tex")
Exe(x, R = TRUE)

a <- 1
b <- 2
c <- 3
d <- 4
eval(Exe(x, R = TRUE))

# `det.yac_symbol` from `Ryacas`
Ryacas::det(A)

# `det` from `base` R

A <- matrix(c(a, c, b, d), ncol = 2)
det(A)

jeksterslab/yacR documentation built on Feb. 27, 2021, 3:45 a.m.