swap: Swap polynomial indeterminates

View source: R/swap.R

swapR Documentation

Swap polynomial indeterminates

Description

Swap polynomial indeterminates

Usage

swap(p, variable, replacement)

Arguments

p

polynomial

variable

the variable in the polynomial to replace

replacement

the replacement variable

Value

a mpoly object

Author(s)

David Kahle

Examples


(p <- mp("(x + y)^2"))
swap(p, "x", "t")

## the meta data is retained
(p <- bernstein(3, 5))
(p2 <- swap(p, "x", "t"))
is.bernstein(p2)

(p <- chebyshev(3))
(p2 <- swap(p, "x", "t"))
is.chebyshev(p2)



dkahle/mpoly documentation built on July 27, 2023, 11:44 p.m.