Learn R Programming

caracas (version 1.0.1)

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

Examples

Run this code
# NOT RUN {
if (have_sympy()) {
   x <- symbol('x')
   e <- 2*x^2
   e
   subs(e, "x", "2")
   y <- as_symbol("2")
   subs(e, "x", y)
}

# }

Run the code above in your browser using DataLab