R/simplify.R
collect.Rd
Collects common powers of a term in an expression
collect(x, a)
A caracas_symbol
caracas_symbol
if (has_sympy()){ def_sym(x, y, z) expr = x*y + x - 3 + 2*x**2 - z*x**2 + x**3 collect(expr, x) } #> c: 3 2 #> x + x ⋅(2 - z) + x⋅(y + 1) - 3