Substitute symbol for value

subs(s, x, v)

Arguments

s

Expression

x

Name of symbol (character)

v

Value for x

See also

Examples

if (has_sympy()) { x <- symbol('x') e <- 2*x^2 e subs(e, "x", "2") y <- as_sym("2") subs(e, "x", y) }
#> [caracas]: 8