swapVariables | R Documentation |
Swap two variables of a ratioOfQsprays
.
## S4 method for signature 'ratioOfQsprays,numeric,numeric'
swapVariables(x, i, j)
x |
a |
i , j |
indices of the variables to be swapped |
A ratioOfQsprays
object.
library(ratioOfQsprays)
f <- function(x, y, z) {
(x^2 + 5*y + z - 1) / (x + 1)
}
x <- qlone(1)
y <- qlone(2)
z <- qlone(3)
R <- f(x, y, z)
S <- swapVariables(R, 2, 3)
S == f(x, z, y) # should be TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.