Learn R Programming

symbolicQspray (version 1.1.0)

permuteVariables: Permute variables

Description

Permute the variables of a symbolicQspray polynomial.

Usage

# S4 method for symbolicQspray,numeric
permuteVariables(x, permutation)

Value

A symbolicQspray object.

Arguments

x

a symbolicQspray object

permutation

a permutation

Examples

Run this code
f <- function(a1, a2, X, Y, Z) {
  (a1^2 + 5*a2) / (a1 + 1) * X^2*Y  +  (3*a1 - a2) / a2 * Y^3
}
a1 <- qlone(1)
a2 <- qlone(2)
X <- Qlone(1)
Y <- Qlone(2)
Z <- Qlone(3)
Qspray <- f(a1, a2, X, Y, Z)
perm <- c(3, 1, 2)
permuteVariables(Qspray, perm) == f(a1, a2, Z, X, Y) # should be TRUE

Run the code above in your browser using DataLab