swapVariables {ratioOfQsprays}R Documentation

Swap variables

Description

Swap two variables of a ratioOfQsprays.

Usage

## S4 method for signature 'ratioOfQsprays,numeric,numeric'
swapVariables(x, i, j)

Arguments

x

a ratioOfQsprays object

i, j

indices of the variables to be swapped

Value

A ratioOfQsprays object.

Examples

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

[Package ratioOfQsprays version 1.1.0 Index]