swapVariables {qspray} | R Documentation |
Swap variables
Description
Swap two variables in a qspray
polynomial.
Usage
## S4 method for signature 'qspray,numeric,numeric'
swapVariables(x, i, j)
Arguments
x |
a |
i , j |
indices of the variables to be swapped |
Value
A qspray
object.
Examples
library(qspray)
f <- function(x, y, z) {
x^2 + 5*y + z - 1
}
x <- qlone(1)
y <- qlone(2)
z <- qlone(3)
P <- f(x, y, z)
Q <- swapVariables(P, 2, 3)
Q == f(x, z, y) # should be TRUE
[Package qspray version 3.1.0 Index]