Ryacas0 (version 0.4.2)

yacas: yacas interface

Description

Interface to the yacas computer algebra system.

Usage

yacas(x, ...)
# S3 method for character
yacas(x, verbose = FALSE, method, 
    retclass = c("expression", "character", "unquote"), 
    addSemi = TRUE, ...)

Arguments

x

A yacas character string or an R expression without terminating semicolon to be processed by yacas.

Additional arguments ultimately passed down to yacas.character.

verbose

A logical value indicating verbosity of output or "input" to only show input to yacas but not output from yacas or "output" to only show output from yacas but not input to yacas.

method

method used to communicate with yacas. If "socket" is specified then the same yacas session is used on a sequence of calls. If "system" is specified then a new instance of yacas is used just for the period of that call. "system" does not require that the system be configured to support telnet/sockets and so may be useful in some instances. If no value is specified the default is taken from getOption("yacas.method") and if that is not specified "socket" is used. "socket" and "system" may be abbreviated.

addSemi

If TRUE a semicolon is added to the character string sent to yacas. This can be set to FALSE if its known that the character string already has a trailing semicolon. It is ignored if retclass="expression".

retclass

The class of the first component of the yacas structure. It defaults to "expression" but may be specified as "character" or "unquote". "unquote" is the same as "character" except that if the character string returned would have otherwise had quotes in the first and and last positions then they are stripped.

Value

An R object of class "yacas" is returned. If PrettyPrinter("OMForm") is in effect, which it is by default, then the first component is an R expression and the OMForm component contains OpenMath XML code. In other cases the first component is NULL and the YacasForm or PrettyForm components have display information.

Generally an expression. Refer to details.

Details

The user supplies an R expression, an R function name corresponding to a function with a single line body, a formula or a yacas input string. In the case of a formula it is regarded as an expression represented by the right hand side of the formula while the left hand side, if any, is ignored.

Note the silent version syacas().

References

http://yacas.sourceforge.net

Examples

Run this code
# NOT RUN {
yacas(expression(Factor(x^2-1)))
exp1 <- expression(x^2 + 2 * x^2)
exp2 <- expression(2 * exp0)
exp3 <- expression(6 * pi * x)
exp4 <- expression((exp1 * (1 - sin(exp3))) / exp2)
print(yacas(exp4))

print(yacas("Version()")) # yacas version

# see demo("Ryacas-Function")

# }

Run the code above in your browser using DataCamp Workspace