Learn R Programming

caracas (version 1.1.2)

subs: 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

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

Run the code above in your browser using DataLab