Learn R Programming

polynomial (version 0.1.0)

exponents: Polynomial Exponents

Description

Functions to get or set the exponents of a polynomial.

Usage

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.

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.)

Details

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

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab