constant | R Documentation |
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.
is.constant(x)
constant(x,drop=FALSE)
constant(x) <- value
drop(x)
x |
Object of class spray |
value |
Numeric value to set the constant coefficient to |
drop |
Boolean, with default |
In function constant()
, return the coefficient, or a constant
multivariate polynomial, depending on the value of drop
.
The behaviour of the drop
argument (sort of) matches that of the
spray extractor method. Function drop()
returns the elements of
the coefficients.
Function constant()
ensures that zero spray objects retain the
argument's arity.
It might have been better to call is.constant()
is.scalar()
, for consistency with the stokes
and
clifford
packages. But this is not clear.
Robin K. S. Hankin
Extract
(S <- spray(partitions::blockparts(rep(2,3),3,TRUE)))
constant(S)
constant(S) <- 33
S
drop(constant(S,drop=FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.