subs {caracas}R Documentation

Substitute symbol for value

Description

Substitute symbol for value

Usage

subs(s, x, v)

Arguments

s

Expression

x

Name of symbol (character)

v

Value for x

See Also

subs_vec(), subs_lst()

Examples

if (has_sympy()) {
   x <- symbol('x')
   e <- 2*x^2
   e
   subs(e, "x", "2")
   y <- as_sym("2")
   subs(e, "x", y)
}


[Package caracas version 1.1.0 Index]