changeVariables {qspray}R Documentation

Change of variables in a 'qspray' polynomial

Description

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(x^2, x+y+1). This is an alias of composeQspray.

Usage

## S4 method for signature 'qspray,list'
changeVariables(x, listOfQsprays)

Arguments

x

a qspray polynomial

listOfQsprays

a list containing at least n qspray objects, or objects coercable to qspray objects, where n is the number of variables of the polynomial given in the x argument

Value

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^2
Y <- x + y + 1
changeVariables(P, list(X, Y)) == f(X, Y) # should be TRUE

[Package qspray version 3.0.0 Index]