sympy_func {caracas}R Documentation

Call a SymPy function directly on x

Description

Call a SymPy function directly on x

Usage

sympy_func(x, fun, ...)

Arguments

x

Object to call fun on

fun

Function to call

...

Passed on to fun

Examples

if (has_sympy()) {
  def_sym(x, a)
  p <- (x-a)^4
  p
  q <- p %>% sympy_func("expand")
  q
  q %>% sympy_func("factor")
  
  def_sym(x, y, z)
  expr <- x*y + x - 3 + 2*x^2 - z*x^2 + x^3
  expr
  expr %>% sympy_func("collect", x) 
}
 

[Package caracas version 1.1.0 Index]