Replaces the variables of a qspray polynomial with some qspray polynomials. E.g. you have a polynomial P(x,y)
and you want the polynomial P(x2,x+y+1). This is an alias of composeQspray.
methods
## S4 method for signature 'qspray,list'changeVariables(x, listOfQsprays)
Arguments
x: a qspray polynomial
listOfQsprays: a list containing at least nqspray
objects, or objects coercible to qspray objects, where n
is the number of variables of the polynomial given in the x
argument; if this list is named, then its names will be used in the show options of the result
Returns
The qspray polynomial obtained by replacing the variables of the polynomial given in the x argument with the polynomials given in the listOfQsprays argument.
Examples
library(qspray)f <-function(x, y) x*y/2+4*y
x <- qlone(1)y <- qlone(2)P <- f(x, y)X <- x^2Y <- x + y +1changeVariables(P, list(X, Y))== f(X, Y)# should be TRUE