Learn R Programming

spray (version 1.0-26)

constant: Get or set the constant term of a spray object

Description

The constant term of a spray object is the coefficient corresponding to an index of all zeros. These functions get or set the constant of a spray object.

Usage

is.constant(x)
constant(x,drop=FALSE)
constant(x) <- value
drop(x)

Value

In function constant(), return the coefficient, or a constant multivariate polynomial, depending on the value of drop.

Arguments

x

Object of class spray

value

Numeric value to set the constant coefficient to

drop

Boolean, with default FALSE meaning to return a spray object and TRUE meaning to return a numeric value

Author

Robin K. S. Hankin

See Also

Examples

Run this code
(S <- spray(partitions::blockparts(rep(2,3),3,TRUE)))

constant(S)
constant(S) <- 33

S

drop(constant(S,drop=FALSE))

Run the code above in your browser using DataLab