Skip to contents

This function updates the closed form expression. It will not update the symbol values. For updating symbol values, please check CLOSED_FORM$set_sym.

Arguments

expr

Formula. Only the right hand side of the last ~ will be kept as the final expression.

Value

Return the object itself.

Examples


# Constant variable
a <- 1

# Random uniform variable
z <- closed_form(~2 + a)

z$compute()
#> [1] 3

# Update the expression
z$set_expr(~2 - a)

z$compute()
#> [1] 1