substituteVariables | R Documentation |
Substitutes some values to the variables of a
symbolicQspray
polynomial.
substituteVariables(Qspray, values)
Qspray |
a |
values |
vector of values to be substituted to the variables; these
values must be coercible to |
A ratioOfQsprays
object.
Use changeVariables
to apply a transformation of the
variables. Use substituteParameters
to substitute some
values to the parameters.
library(symbolicQspray)
f <- function(a1, a2, X, Y) {
(a1 + 2)*X^2*Y + (a2/(a1^2+a2))*X*Y
}
a1 <- qlone(1); a2 <- qlone(2)
Qspray <- f(a1, a2, Qlone(1), Qlone(2))
values <- c(3, "2/3")
( rOQ <- substituteVariables(Qspray, values) )
values <- gmp::as.bigq(values)
rOQ == f(a1, a2, values[1], values[2]) ## should be TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.