mvp (version 1.0-8)

as.function.mvp: Functional form for multivariate polynomials

Description

Coerces a multivariate polynomial into a function

Usage

# S3 method for mvp
as.function(x, ...)

Arguments

x

Multivariate polynomial

...

Further arguments (currently ignored)

Examples

Run this code
# NOT RUN {
p <- as.mvp("1+a^2 + a*b^2 + c")
p
f <- as.function(p)

f(a=1)
f(a=1,b=2)
f(a=1,b=2,c=3)             # coerces to a scalar
f(a=1,b=2,c=3,lose=FALSE)  # formal mvp object
# }

Run the code above in your browser using DataCamp Workspace