Skip to contents

sstr() gives the SymPy style string form with R operators, so the result can be parsed again with sympify(). srepr() shows the expression tree.

Usage

sstr(e)

srepr(e)

Arguments

e

A sym expression.

Value

A character scalar.

Examples

x <- Symbol("x")
sstr(x^2 + 2*x + 1)
#> [1] "x^2 + 2*x + 1"
srepr(x^2 + 1)
#> [1] "Add(Integer(1), Pow(Symbol('x'), Integer(2)))"