swapVariables {symbolicQspray} | R Documentation |
Swap variables
Description
Swap two variables of a symbolicQspray
.
Usage
## S4 method for signature 'symbolicQspray,numeric,numeric'
swapVariables(x, i, j)
Arguments
x |
a |
i , j |
indices of the variables to be swapped |
Value
A symbolicQspray
object.
Examples
library(symbolicQspray)
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)
swapVariables(Qspray, 2, 3) == f(a1, a2, X, Z, Y) # should be TRUE
[Package symbolicQspray version 1.1.0 Index]