exponents: Polynomial Exponents

Description Usage Arguments Details Value Examples

Description

Functions to get or set the exponents of a polynomial.

Usage

1
2
exponents(x)
exponents(x) <- value

Arguments

x

a polynomial, or an object which can be coerced by as.polynomial to a polynomial.

value

an integer vector of the same length as x, or NULL.

Details

exponents and exponents<- get and set the "exponents" attribute of a polynomial.

Value

For exponents, an integer vector of the same length as x. (NULL indicates that the polynomial has default exponents, given by seq(0L, along.with = x)).

For exponents<-, the updated object. (Note that the value of exponents(x) <- value is that of the assignment, value, not the return value from the left-hand side.)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x <- 1:10


## 'x' has NULL exponents, representing the default exponents
exponents(x)


## using 'exponents<-' on an object that is not
## a polynomial coerces the object to polynomial
exponents(x) <- 9:0
is.polynomial(x)
x

polynomial documentation built on Feb. 22, 2021, 5:08 p.m.